DataFusion: aggregating a dictionary column across partitions overflows the key type ("Dictionary key bigger than the key type")
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 43/100
Rechercherichtung
The payload identifies repros/datafusion/dict_key_overflow.py on a linked branch as a minimal reproduction; start by running it with the stated DataFusion 54.0.0 and PyArrow 23.0.0 environment. The issue says a paste-in Rust test is in that repro's README, but gives no DataFusion source file to change. Done means the grouped aggregation succeeds when partitions have disjoint dictionary values that exceed the Int8 key range.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Tracking issue for an upstream DataFusion bug (to file against apache/datafusion). One of two blockers for dictionary-encoding coordinate columns (#217).
Summary
GROUP BY over a dictionary-typed column fails when the combined dictionary across partitions exceeds the per-batch key width:
DataFusion error: Arrow error: Dictionary key bigger than the key type
Each input partition is a valid Dictionary(Int8, Int64) — its dictionary has ≤128 distinct values, so an Int8 key is legal per batch. But the partitions carry disjoint values, so when the aggregate combines them the combined dictionary exceeds 128 entries and the Int8 key overflows.
Minimal repro
Pure datafusion + pyarrow, no xarray-sql, no network: repros/datafusion/dict_key_overflow.py (branch claude/datafusion-upstream-repros-fs1bqv; a paste-in Rust test is in the README).
# 50 partitions, each Dictionary(Int8, Int64) of 100 DISJOINT values
# -> combined cardinality 5000 >> Int8 max (127)
ctx.sql("SELECT k, SUM(v) FROM t GROUP BY k") # -> "Dictionary key bigger than the key type"
The disjoint values matter: when every partition shares the same dictionary values, arrow unifies them and there is no overflow — which is why this is intermittent and version-sensitive in the wild (it does not reproduce on arrow-rs 58.3 when the values coincide).
Expected
Combining dictionary-typed columns across partitions should not fail on a key type that was valid for each input batch. It should widen the key (Int8 → Int16 → …) or decode, since a producer cannot know per batch how large the combined dictionary will become downstream.
Environment
datafusion 54.0.0 / pyarrow 23.0.0 (arrow-rs 58.3.0).
Impact on xarray-sql
Blocks dictionary-encoding coordinate columns (#217): an unchunked coordinate repeated across partitions, or a chunked coordinate whose partitions hold disjoint slices, can exceed a narrow key under streaming aggregation. Reported downstream in #217 by @ghostiee-11.
- Vorherrschende Sprache
- Python
- Sterne
- 142
- Forks
- 19
- Ø Merge
- 1 T. 9 Std.
- Gemergte PRs (30 T.)
- 10
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 xqlsystems/xarray-sql
-
documentation
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 85/100
xqlsystems/xarray-sql#268 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
xqlsystems/xarray-sql#267 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 74/100
xqlsystems/xarray-sql#243 ·
Maintainer antworten meist innerhalb von 1 Tag
-
publish.yml: the TestPyPI verification step is unreachable (and installs the wrong package name)Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
xqlsystems/xarray-sql#242 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
xqlsystems/xarray-sql#237 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in xqlsystems/xarray-sql
Ähnliche Issues
-
documentation good first issue help wanted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
drevendev/HungryCrab#273 ·
Maintainer antworten meist innerhalb von 1 Tag
-
good first issue help wanted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
drevendev/BeautifulRepo#19 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Moonshot: Kimi K3 always sends `reasoning_effort="max"`, though the API now accepts `low` and `high`Offenaccepted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
UKGovernmentBEIS/inspect_ai#5939 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug linux
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Maintainer antworten meist innerhalb von 1 Tag
-
area:data data-quality
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
reacher-z/Awesome-CUA#1468 ·
Maintainer antworten meist innerhalb von 1 Tag