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

Đang mở
#19,064 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@mhatipog đang làm issue này rồi.

Từ ngày 20/11/2026.

  • #19065 của @mhatipog — đang mở

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
20/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
java, spark
Lĩnh vực
backend, databases

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
Java
Star
9.4k
Fork
3.7k
Merge trung bình
2 ngày 15 giờ
Pull request đã merge (30 ngày)
169

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apache/iceberg

Tất cả issue của apache/iceberg

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.