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

   ### Apache Iceberg version
   
   main (development)
   
   ### Query engine
   
   Spark
   
   ### Please describe the bug 🐞
   
   After a column rename that is not followed by a commit, 
`compute_table_stats` rejects the new column name. If two columns swap names, 
it silently computes the statistics of the other column instead (the blob is 
written for the old field ID). Reproduced on `main` (3bfa3e4, 2026-12-01) and 
1.12.0, Spark 3.5.5.
   
   ### Reproduction
   
   ```sql
   CREATE TABLE local.db.t (id INT, a STRING) USING iceberg;
   INSERT INTO local.db.t VALUES (1, 'x');
   ALTER TABLE local.db.t RENAME COLUMN a TO a2;
   CALL local.system.compute_table_stats(table => 'db.t', columns => 
array('a2'));
   
   -- control: one more commit after the rename
   CREATE TABLE local.db.c (id INT, a STRING) USING iceberg;
   INSERT INTO local.db.c VALUES (1, 'x');
   ALTER TABLE local.db.c RENAME COLUMN a TO a2;
   INSERT INTO local.db.c VALUES (2, 'y');
   CALL local.system.compute_table_stats(table => 'db.c', columns => 
array('a2'));
   ```
   
   ### Expected
   
   | Query | Result |
   |---|---|
   | `compute_table_stats` on `t` | writes a statistics file for `a2` |
   | `compute_table_stats` on `c` (control) | writes a statistics file |
   
   ### Actual
   
   | Query | Result |
   |---|---|
   | `compute_table_stats` on `t` | `IllegalArgumentException: Can't find 
column a2 in table { 1: id, 2: a }` |
   | `compute_table_stats` on `c` (control) | writes a statistics file |
   
   ### 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