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

オープン
#19,064 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@mhatipog がすでに取り組んでいます。

2026年11月20日 から。

  • #19065 @mhatipog による — オープン

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
20/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
java, spark
領域
backend, databases

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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
主要言語
Java
スター
9.4k
フォーク
3.7k
平均マージ
2日 15時間
マージ済み PR(30日)
169

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/iceberg のほかの issue

apache/iceberg の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。