[VL] Pandas UDFs fail with "Cannot retain a released vector" on partitions with more than one batch

Aperta
#13,706 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

@LuciferYang ci sta già lavorando.

Dal 21/11/2026.

  • #13707 di @LuciferYang — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
22/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
pandas, python, scala, spark

Direzione di ricerca

The failure is in ColumnarArrowEvalPythonExec.scala, where adjustRefCnt retains vectors that RefCountedArrowColumnVector.java has already released after the first joined batch. Read how the Python runner's reader reuses the Arrow stream root's vectors, then reproduce with a pandas UDF over a 10,000-row Parquet partition. Done means the second batch no longer hits the released-vector error; PR #13707 is already open against this, so check it first.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Since #13280, a scalar pandas UDF that runs in ColumnarArrowEvalPythonExec fails when a partition sends more than one batch to Python, which happens once a partition has more than spark.gluten.sql.columnar.maxBatchSize rows (4096 by default):

java.lang.IllegalStateException: Cannot retain a released vector
	at org.apache.gluten.vectorized.RefCountedArrowColumnVector.retain(RefCountedArrowColumnVector.java:49)
	at org.apache.spark.api.python.ColumnarArrowEvalPythonExec.adjustRefCnt(ColumnarArrowEvalPythonExec.scala:519)

The Python runner's reader returns every output batch over the same RefCountedArrowColumnVectors, which wrap the vectors of the Arrow stream reader's root. Closing the first joined batch releases them, and the second batch then retains a released vector.

It reproduces on v1.8.0-rc1 with the default configuration: a pandas UDF over a single 10,000-row Parquet partition fails.

This issue was written with the assistance of AI (Claude Opus).

Lingua principale
Scala
Stelle
1.6k
Fork
685
Merge medio
4g 16h
PR unite (30g)
84

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 apache/gluten

Tutte le issue di apache/gluten

Issue simili

Altre issue su Scala

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.