`select()` ignores `distinct`
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Inizia eseguendo il riproduttore Python dell’issue con la DuckDB table API e verifica come select("DISTINCT a, b") e distinct() costruiscono le loro query SQL. L’issue è completata quando la query include SELECT DISTINCT a, b FROM main.foo, oppure quando l’API solleva un’eccezione chiara se quella forma non è supportata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happens?
select("distinct <columns>") ignores distinct.
Expected behavior: a) throw an exception if this is not supported or b) apply the distinct.
E.g. select(count("*") throws an exception _duckdb.BinderException: Binder Error: Aggregates cannot be present in a Project relation!
To Reproduce
import duckdb
import pandas as pd
df = pd.DataFrame({"a": [1, 2, 1, 1], "b": [10, 10, 10, 20], "c": [0, 1, 2, 3]})
duckdb.execute("CREATE TABLE foo AS SELECT * FROM df")
sql_query_selectdistinct = duckdb.table("foo").select("DISTINCT a, b").sql_query()
print(sql_query_selectdistinct)
assert "SELECT DISTINCT a, b FROM main.foo" == sql_query_selectdistinct
assert duckdb.table("foo").select("a, b").distinct().sql_query() == sql_query_selectdistinct
Output:
SELECT a, b FROM main.foo
Both assertions fail
OS:
Windows 11 x86_64
DuckDB Package Version:
1.4.1
Python Version:
3.13.6
Full Name:
Clemens Korner
Affiliation:
AIT Austrian Institute of Technology
What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.
I have tested with a stable release
Did you include all relevant data sets for reproducing the issue?
Yes
Did you include all code required to reproduce the issue?
- Yes, I have
Did you include all relevant configuration to reproduce the issue?
- Yes, I have
- Lingua principale
- Python
- Stelle
- 189
- Fork
- 117
- Merge medio
- 1g 58m
- PR unite (30g)
- 15
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di duckdb/duckdb-python
-
needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
duckdb/duckdb-python#633 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
duckdb/duckdb-python#627 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
duckdb/duckdb-python#576 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
duckdb/duckdb-python#534 ·
I maintainer di solito rispondono entro 1 giorno
-
needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
duckdb/duckdb-python#386 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di duckdb/duckdb-python
Issue simili
-
adr
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
kristofdegrave/homeassistant-smart-charging#1607 ·
I maintainer di solito rispondono entro 1 giorno
-
namespace operations
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
EclipseFdn/open-vsx.org#13665 ·
I maintainer di solito rispondono entro 1 giorno
-
doc good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
collective/icalendar#1865 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
canonical/opentelemetry-collector-operator#409 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
mozilla/addons-release-tests#1243 ·
I maintainer di solito rispondono entro 1 giorno