Spark: `changes` table returns swapped values when only some changelog columns are selected

Aperta
#19,192 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@adiranjan25 ci sta già lavorando.

Dal 30/11/2026.

  • #19207 di @adiranjan25 — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
61/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
java, spark
Ambito
backend, databases

Direzione di ricerca

Start by tracing how Spark plans projections for the Iceberg changes table, especially when only selected changelog columns or a metadata column are requested. Reproduce the three SQL queries in the issue on Spark 3.5.5 and compare their results with the expected values. Done means partial selections return each value in the correct column and the single-column query no longer throws a ClassCastException.

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

Descrizione

bug
Apache Iceberg version

1.12.0 (latest release)

Query engine

Spark

Please describe the bug 🐞

Selecting only some of _change_type, _change_ordinal and _commit_snapshot_id from a changes table, or one of them together with a metadata column, returns values in the wrong columns or fails with a ClassCastException. Reproduced on main (9d4f6c7, 2026-11-28) and 1.12.0, Spark 3.5.5.

Reproduction
CREATE TABLE local.db.t (id INT, data STRING) USING iceberg;
INSERT INTO local.db.t VALUES (1, 'a');

-- control: all three changelog columns
SELECT 'all', id, _change_type, _change_ordinal, _commit_snapshot_id FROM local.db.t.changes;
SELECT 'with _file', id, _change_type, substring_index(_file, '/', -1) FROM local.db.t.changes;
SELECT 'one column', id, _commit_snapshot_id FROM local.db.t.changes;
Expected
Query Result
all (control) 1 INSERT 0 <snapshot id>
with _file 1 INSERT 00000-0-...parquet
one column 1 <snapshot id>
Actual
Query Result
all (control) same
with _file 1 file:/.../00000-0-...parquet INSERT
one column ClassCastException: UTF8String cannot be cast to Long
Willingness to contribute
  • I can contribute a fix for this bug independently
  • I would be willing to contribute a fix for this bug with guidance from the Iceberg community
  • I cannot contribute a fix for this bug at this time
Lingua principale
Java
Stelle
9.5k
Fork
3.7k
Merge medio
2g 2h
PR unite (30g)
170

Preparare l'ambiente

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/iceberg

Tutte le issue di apache/iceberg

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.