Yibo-Dong opened a new issue, #19189:
URL: https://github.com/apache/iceberg/issues/19189

   ### Apache Iceberg version
   
   1.12.0 (latest release)
   
   ### Query engine
   
   Spark
   
   ### Please describe the bug 🐞
   
   In a table partitioned by a nested field (`PARTITIONED BY (s.a)`), a row 
whose struct `s` is NULL is read as `{a: null}` when the query reads only 
`s.a`, so `s IS NULL` is false. `DELETE ... WHERE s IS NULL OR ...` misses such 
rows, and if `s` has no other field, copy-on-write DML and `rewrite_data_files` 
store the wrong value permanently. Reproduced on `main` (9d4f6c7, 2026-11-28) 
and 1.12.0, Spark 3.5.5.
   
   ### Reproduction
   
   ```sql
   CREATE TABLE local.db.t (id INT, s STRUCT<a: INT, b: STRING>) USING iceberg 
PARTITIONED BY (s.a);
   -- control: unpartitioned
   CREATE TABLE local.db.c (id INT, s STRUCT<a: INT, b: STRING>) USING iceberg;
   INSERT INTO local.db.t VALUES (1, named_struct('a', 1, 'b', 'x')), (2, NULL);
   INSERT INTO local.db.c VALUES (1, named_struct('a', 1, 'b', 'x')), (2, NULL);
   
   SELECT 't', id, s.a, s IS NULL FROM local.db.t ORDER BY id;
   SELECT 'c', id, s.a, s IS NULL FROM local.db.c ORDER BY id;
   ```
   
   ### Expected
   
   | Query | Result |
   |---|---|
   | `t`, id 2 | `2 NULL true` |
   | `c` (control) | `2 NULL true` |
   
   ### Actual
   
   | Query | Result |
   |---|---|
   | `t`, id 2 | `2 NULL false` |
   | `c` (control) | `2 NULL true` |
   
   ### 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
   - [x] I cannot contribute a fix for this bug at this time


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to