JVM columnar shuffle panics on a struct column with a NullType field
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- data-engineering
Direzione di ricerca
Inizia in native/shuffle/src/spark_unsafe/row.rs dalle due funzioni field-major, append_struct_fields_field_major e append_nested_struct_fields_field_major, che raggiungono unreachable! per DataType::Null. Confronta con il ramo Null già presente in append_field nello stesso file per vedere come viene aggiunto un null per riga. È completato quando le tre riproduzioni SQL della issue restituiscono le righe di Spark, con un test di regressione che copra uno struct di primo livello e uno struct annidato con un campo null.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
A shuffle that runs on Comet's JVM columnar shuffle fails the query when one of its columns is a struct with a NullType field, such as named_struct('x', a, 'n', null). The row-to-Arrow conversion panics:
org.apache.comet.CometNativeException: internal error: entered unreachable code: Unsupported data type of struct field: Null
at datafusion_comet_shuffle::spark_unsafe::row::append_struct_fields_field_major
at datafusion_comet_shuffle::spark_unsafe::row::append_columns
at datafusion_comet_shuffle::spark_unsafe::row::process_sorted_row_partition
at comet::execution::jni_api::write_sorted_file
at comet::execution::jni_api::Java_org_apache_comet_Native_writeSortedFileNative
Spark returns the rows. Both field-major struct paths in native/shuffle/src/spark_unsafe/row.rs lack a DataType::Null arm and fall through to unreachable!. append_struct_fields_field_major handles a top-level struct column, and append_nested_struct_fields_field_major handles a struct inside a struct:
append_field in the same file already has the arm. The JVM columnar shuffle's type check accepts NullType at any depth, so nothing keeps these schemas away from the converter, and Null is the only type that check accepts that the two functions are missing.
With the default configuration this hits every round-robin repartition of such a column, because native round robin is off by default and those shuffles run on JVM columnar shuffle. It also hits a hash shuffle that runs on JVM columnar shuffle, for example under spark.comet.shuffle.mode=jvm. A hash shuffle over a native child runs on native shuffle and works. Arrays and maps that hold nulls (array(null), map(k, null), array(named_struct('x', a, 'n', null))) also work.
Steps to reproduce
CREATE TABLE t (a INT) USING parquet;
INSERT INTO t SELECT CAST(id AS INT) FROM range(1000);
-- top-level struct column
SELECT /*+ REPARTITION(4) */ a, named_struct('x', a, 'n', null) AS st FROM t;
-- struct inside a struct
SELECT /*+ REPARTITION(4) */ a, named_struct('s', named_struct('x', a, 'n', null)) AS st FROM t;
-- hash partitioning on JVM columnar shuffle
SET spark.comet.shuffle.mode=jvm;
SELECT a, named_struct('x', a, 'n', null) AS st FROM t DISTRIBUTE BY a;
All three fail with the panic above. I reproduced them on c3316fbe39 with the Spark 4.1 profile, and the code involved is unchanged on main at 3a4a159409.
Expected behavior
The queries should return the same rows as Spark. Every value of a NullType field is null, so a DataType::Null arm in both functions that appends one null per row, as append_field does, should be enough. A regression test with a top-level and a nested struct would cover both paths.
Additional context
#6977 proposes merging the two field-major functions, which would make an arm like this one change instead of two.
- Lingua principale
- Scala
- Stelle
- 1.3k
- Fork
- 391
- Merge medio
- 2g 10h
- PR unite (30g)
- 421
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un 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 apache/datafusion-comet
-
area:shuffle enhancement good first issue performance requires-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/datafusion-comet#7072 ·
I maintainer di solito rispondono entro 1 giorno
-
Native hashing of NullType and ANSI interval values fails with "Unsupported data type in hasher"Forse già presa Una pull request collegata a questa issue è aperta o già unita. Apertaarea:expressions area:shuffle bug priority:high requires-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
apache/datafusion-comet#7063 ·
I maintainer di solito rispondono entro 1 giorno
-
requires-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
apache/datafusion-comet#7001 ·
I maintainer di solito rispondono entro 1 giorno
-
Extract shared list-array construction from the split_* functions in split.rsForse già presa @arminazimi l’ha presa 2 giorni fa. Apertaarea:expressions enhancement good first issue help wanted requires-triage rust tech debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
apache/datafusion-comet#6983 ·
I maintainer di solito rispondono entro 1 giorno
-
Deduplicate spark_ceil and spark_floor and port floor's decimal boundary tests to ceilForse già presa @med9110 l’ha presa 2 giorni fa. Apertaarea:expressions enhancement help wanted requires-triage rust tech debt
Difficoltà 2/5 Mezza giornata Idoneità per principianti 68/100
apache/datafusion-comet#6974 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di apache/datafusion-comet
Issue simili
-
Bound wrong-magic P2P diagnostics to parsed header bytesForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
ergoplatform/ergo#2736 ·
I maintainer di solito rispondono entro 1 giorno
-
bug 🐞 CI/CD ⚒️
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
valkey-io/valkey-glide#7370 ·
I maintainer di solito rispondono entro 1 giorno
-
Improve UI text on confirmation page (at registration)Forse già presa @Arghyann l’ha presa oggi. Apertagood first issue improvement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
lichess-org/lila#22126 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[VL] Remove the unused ShuffleSchema.hForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
I maintainer di solito rispondono entro 2 giorni
-
agent-ready area/dev-tooling kind/docs-only layer/docs size/XS
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
marola-dev/marola#855 ·
I maintainer di solito rispondono entro 1 giorno