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

   ### Apache Iceberg version
   
   1.12.0 (latest release)
   
   ### Query engine
   
   Spark
   
   ### Please describe the bug 🐞
   
   On a table with `write.wap.enabled=true`, `REPLACE TABLE ... AS SELECT` with 
`spark.wap.branch` set empties `main` immediately, although WAP must not change 
`main`, and appends the result to the WAP branch instead of replacing it. With 
`spark.wap.id`, `main` is emptied too. Reproduced on `main` (9d4f6c7, 
2026-11-28) and 1.12.0, Spark 3.5.5.
   
   ### Reproduction
   
   ```sql
   CREATE TABLE local.db.t (id INT) USING iceberg TBLPROPERTIES 
('write.wap.enabled'='true');
   INSERT INTO local.db.t VALUES (5);
   ALTER TABLE local.db.t CREATE BRANCH audit;
   
   SET spark.wap.branch=audit;
   REPLACE TABLE local.db.t USING iceberg AS SELECT 2 id;
   RESET spark.wap.branch;
   
   SELECT 'main', collect_list(id) FROM local.db.t;
   SELECT 'audit', collect_list(id) FROM (SELECT id FROM 
local.db.t.branch_audit ORDER BY id);
   ```
   
   ### Expected
   
   | Query | Result |
   |---|---|
   | `main` | `[5]` |
   | `audit` | `[2]` |
   
   ### Actual
   
   | Query | Result |
   |---|---|
   | `main` | `[]` |
   | `audit` | `[2,5]` |
   
   
   ### 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