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

   ### Apache Iceberg version
   
   main (development)
   
   ### Query engine
   
   Spark
   
   ### Please describe the bug 🐞
   
   An Iceberg view `SELECT * FROM t` returns the values of the wrong columns 
after a column is added to `t` at a non-final position (`ADD COLUMN ... FIRST` 
/ `AFTER`): below, view column `a` returns the new column `z` and `b` returns 
`a`. A Spark session-catalog view with the same body is correct. Reproduced on 
`main` (3bfa3e4, 2026-12-01) and 1.12.0, Spark 3.5.5.
   
   ### Reproduction
   
   `mem` is an Iceberg `InMemoryCatalog` (it supports views):
   
   ```
   spark-sql --conf 
spark.sql.extensions=org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions
 \
     --conf spark.sql.catalog.mem=org.apache.iceberg.spark.SparkCatalog \
     --conf 
spark.sql.catalog.mem.catalog-impl=org.apache.iceberg.inmemory.InMemoryCatalog \
     --conf spark.sql.catalog.mem.warehouse=/tmp/memwh
   ```
   
   ```sql
   CREATE NAMESPACE mem.db;
   CREATE TABLE mem.db.t (a INT, b INT) USING iceberg;
   INSERT INTO mem.db.t VALUES (1, 10);
   CREATE VIEW mem.db.v AS SELECT * FROM mem.db.t;
   -- control: a Spark session-catalog view with the same body
   CREATE VIEW default.spark_v AS SELECT * FROM mem.db.t;
   
   ALTER TABLE mem.db.t ADD COLUMN z INT FIRST;
   
   SELECT 'spark view', * FROM default.spark_v;
   SELECT 'iceberg view', * FROM mem.db.v;
   ```
   
   ### Expected
   
   | Query | Result |
   |---|---|
   | `spark view` (control) | `1 10` |
   | `iceberg view` | `1 10` |
   
   ### Actual
   
   | Query | Result |
   |---|---|
   | `spark view` (control) | `1 10` |
   | `iceberg view` | `NULL 1` |
   
   ### 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