`select()` ignores `distinct`
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 45/100
Rechercherichtung
Beginne damit, den Python-Reproducer im Issue mit der DuckDB table API auszuführen und zu untersuchen, wie select("DISTINCT a, b") und distinct() ihre SQL-Abfragen erstellen. Das Issue ist abgeschlossen, wenn die Abfrage SELECT DISTINCT a, b FROM main.foo enthält oder wenn die API eine klare Ausnahme auslöst, falls diese Form nicht unterstützt wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- Python
- Sterne
- 194
- Forks
- 119
- Ø Merge
- 17 Std. 33 Min.
- Gemergte PRs (30 T.)
- 49
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus duckdb/duckdb-python
-
needs triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
duckdb/duckdb-python#708 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Type stubs omit the `connection` keyword on module-level `read_json` and `write_csv`Evtl. vergeben @tojacob03 hat das vor 26 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 90/100
duckdb/duckdb-python#627 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
`read_json` accepts a list of paths at runtime but the type stub only allows a single path.Evtl. vergeben @aleks-drozy hat das vor 83 Tagen übernommen. Offenneeds triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
duckdb/duckdb-python#576 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Missing ROW_GROUPS_PER_FILE argument in write_parquet functionEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offenneeds triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
duckdb/duckdb-python#386 ·
Maintainer antworten meist innerhalb von 1 Tag
-
needs triage
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 52/100
duckdb/duckdb-python#716 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in duckdb/duckdb-python
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
google-agentic-commerce/AP2#388 ·
-
area:codegen backend:cuda backend:hip bug direction:input
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
CrossGL/crosstl#3061 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
rlaope/oh-my-hermes#2304 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
mochan-tk/agentic-dev-kit-for-codex#64 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Windows ARM memory-leakOffenbug docs performance
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
Maintainer antworten meist innerhalb von 3 Tagen