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

Aperta
#19,064 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@mhatipog ci sta già lavorando.

Dal 20/11/2026.

  • #19065 di @mhatipog — aperta

Valutazione

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

Direzione di ricerca

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.

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

Descrizione

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
Lingua principale
Java
Stelle
9.4k
Fork
3.7k
Merge medio
2g 15h
PR unite (30g)
169

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.