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

Abierto
#19,192 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@adiranjan25 ya está trabajando en esto.

Desde el 30/11/2026.

  • #19207 de @adiranjan25 — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
61/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
java, spark

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
Lenguaje dominante
Java
Estrellas
9.5k
Forks
3.7k
Merge medio
2 d 2 h
PR fusionados (30 d)
170

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de apache/iceberg

Todos los issues de apache/iceberg

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.