Arrow write: one bad value inside a ColumnGroup aborts the whole export, even in Mode.LOYAL

Aperta
#2,075 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@zaleslaw ci sta già lavorando.

Dal 11/9/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

bug files

One value that cannot be converted to the target Arrow type fails the entire write — no file is produced —
when it sits in a column inside a ColumnGroup. Mode.LOYAL is supposed to degrade such a value and report
it to mismatchSubscriber instead of aborting, and it does exactly that for a top-level column.

The reason is where the conversion happens: a ColumnGroup written into an ArrowType.Struct field has its
columns converted inside ArrowWriterImpl.infillVector, outside the try/catch in allocateVectorAndInfill
that applies ArrowWriter.Mode to a failed conversion. So the exception goes straight out of the writer and
the subscriber is never called.

val df = dataFrameOf(DataColumn.createColumnGroup("g", dataFrameOf("x")("abc", "def")))
val schema = Schema(listOf(Field("g", FieldType.nullable(ArrowType.Struct()),
    listOf(Field("x", FieldType.nullable(ArrowType.Int(32, true)), null)))))
df.arrowWriter(schema, ArrowWriter.Mode.LOYAL) { println(it) }
    .use { it.saveArrowFeatherToByteArray() }
// CellConversionException: Failed to convert 'abc' from kotlin.String to kotlin.Int in column 'x', row 0
// mismatchSubscriber: never called

Pre-existing and not specific to a vector type — the same happens for any child vector, e.g.
is IntVector -> column.convertToInt(). Noticed in #2063
(https://github.com/Kotlin/dataframe/pull/2063#discussion_r3981437295).

Lingua principale
Kotlin
Stelle
1.1k
Fork
87
Merge medio
2g 21h
PR unite (30g)
40

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Kotlin/dataframe

Tutte le issue di Kotlin/dataframe

Issue simili

Altre issue su Kotlin

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.