ORC: `IS DISTINCT FROM` skips files where the column is all NULL

Open
#19,191 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@adiranjan25 is already working on this.

Since Nov 29, 2026.

  • #19197 by @adiranjan25 — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
java, spark
Domain
backend, databases

Research direction

Start by checking the open pull request #19197, which is already linked to this issue. The report identifies ORC predicate pushdown for IS DISTINCT FROM as the failing path and gives SQL to reproduce it on Spark 3.5.5; compare the pushed and control query results. Done means the pushed query includes row 3 from the all-NULL stripe, matching the control.

Written by the indexing model from the issue text.

Description

bug
Apache Iceberg version

1.12.0 (latest release)

Query engine

Spark

Please describe the bug 🐞

On ORC tables, WHERE a IS DISTINCT FROM 7 silently drops the NULL rows of a in files (stripes) where a is all NULL. UPDATE and DELETE with this condition miss the same rows. Parquet is correct. Reproduced on main (9d4f6c7, 2026-11-28) and 1.12.0, Spark 3.5.5.

Reproduction
CREATE TABLE local.db.t (id INT, a INT) USING iceberg TBLPROPERTIES ('write.format.default'='orc');
INSERT INTO local.db.t VALUES (1, 3), (2, 7);
-- a file whose column a is all NULL
INSERT INTO local.db.t VALUES (3, NULL);

SELECT 'pushed', collect_list(id) FROM (SELECT id FROM local.db.t WHERE a IS DISTINCT FROM 7 ORDER BY id);
-- control: same predicate, not pushed down
SELECT 'not pushed', collect_list(id) FROM (SELECT id FROM local.db.t WHERE coalesce(a, a) IS DISTINCT FROM 7 ORDER BY id);
Expected
Query Result
pushed [1,3]
not pushed (control) [1,3]
Actual
Query Result
pushed [1]
not pushed (control) [1,3]
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
Dominant language
Java
Stars
9.5k
Forks
3.7k
Avg merge
2d 2h
Merged PRs (30d)
170

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/iceberg

All issues in apache/iceberg

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.