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

   ### Apache Iceberg version
   
   main (development)
   
   ### Query engine
   
   Spark
   
   ### Please describe the bug 🐞
   
   If a Spark table column was added with a `DEFAULT`, its files written before 
the column existed get that value when Spark reads them. After `snapshot` (also 
`migrate` and `add_files`), Iceberg reads these rows as NULL. Reproduced on 
`main` (3bfa3e4, 2026-12-01) and 1.12.0, Spark 3.5.5.
   
   ### Reproduction
   
   ```sql
   CREATE DATABASE db;
   CREATE TABLE db.src (id INT) USING parquet;
   INSERT INTO db.src VALUES (1);
   ALTER TABLE db.src ADD COLUMN c INT DEFAULT 7;
   INSERT INTO db.src (id) VALUES (2);
   
   -- control: the source table
   SELECT 'source', * FROM db.src ORDER BY id;
   CALL local.system.snapshot(source_table => 'spark_catalog.db.src', table => 
'local.db.snap');
   SELECT 'snapshot', * FROM local.db.snap ORDER BY id;
   ```
   
   ### Expected
   
   | Query | Result |
   |---|---|
   | `source` (control) | `1 7`, `2 7` |
   | `snapshot` | `1 7`, `2 7` (or the import fails) |
   
   ### Actual
   
   | Query | Result |
   |---|---|
   | `source` (control) | `1 7`, `2 7` |
   | `snapshot` | `1 NULL`, `2 7` |
   
   
   ### 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