ORC: IS NULL on a struct field misses rows whose parent struct is null

Abierto
#19,064 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@mhatipog ya está trabajando en esto.

Desde el 20/11/2026.

  • #19065 de @mhatipog — abierto

Evaluación

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

Línea de trabajo

Start by tracing OrcMetrics and ExpressionToSearchArgument, the two locations identified in the issue, and compare their handling of nested struct nulls with Spark's fix in SPARK-60362. Check the ORC read and delete paths, including the Trino manifest pruning behavior. Done means the query and DELETE include rows whose parent struct is null, without incorrect pruning.

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

Descripción

Apache Iceberg version

1.12.0 (also reproduces on 1.10.1 and 1.4.3)

Query engine

Spark

Please describe the bug 🐞

On ORC tables, IS NULL on a struct field misses rows where the parent struct is null, in reads and in DELETE:

CREATE TABLE t (id INT, st STRUCT<x: INT>) USING iceberg
  TBLPROPERTIES ('write.format.default' = 'orc');
INSERT INTO t VALUES (1, NULL), (2, named_struct('x', 5));
SELECT id FROM t WHERE st.x IS NULL;   -- no rows, expected 1
DELETE FROM t WHERE st.x IS NULL;      -- row 1 is not deleted

The same table in Parquet returns and deletes row 1.

ORC only stores a struct field where all of its ancestors are present, and hasNull reflects the field's own nulls. Two places read that as "no nulls":

  • OrcMetrics records null_value_count = 0 when hasNull() is false, so IS NULL prunes the file.
  • ExpressionToSearchArgument pushes isNull on the nested column to ORC, which skips the row group based on the same statistics. Spark fixes this in its own ORC reader in SPARK-60362.

Trino reading the same table returns the same wrong result, since it prunes on the manifest counts.

Willingness to contribute
  • I can contribute a fix for this bug independently
Lenguaje dominante
Java
Estrellas
9.4k
Forks
3.7k
Merge medio
2 d 15 h
PR fusionados (30 d)
169

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.