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

   ### Apache Iceberg version
   
   main (development)
   
   ### Query engine
   
   Spark
   
   ### Please describe the bug 🐞
   
   After `DROP COLUMN items.element.a` removes the only field of `items 
ARRAY<STRUCT<a:INT>>`, every read of existing Parquet files fails with `... is 
not in the store`. If the element struct keeps another field, the read works. 
Reproduced on `main` (2e12b22, 2026-11-25) and 1.12.0, Spark 3.5.5.
   
   ### Reproduction
   
   ```sql
   CREATE TABLE local.t (id INT, items ARRAY<STRUCT<a:INT>>) USING iceberg;
   INSERT INTO local.t VALUES (1, array(named_struct('a', 10)));
   CREATE TABLE local.c (id INT, items ARRAY<STRUCT<a:INT, b:INT>>) USING 
iceberg;
   INSERT INTO local.c VALUES (1, array(named_struct('a', 10, 'b', 20)));
   ALTER TABLE local.t DROP COLUMN items.element.a;
   ALTER TABLE local.c DROP COLUMN items.element.a;
   SELECT 'bug', id, size(items), items FROM local.t;          -- fails
   SELECT 'control', id, size(items), items FROM local.c;      -- control
   ```
   
   **Expected:** `bug  1  1  [{}]` (one element, an empty struct).
   
   **Actual:** the control returns `control  1  1  [{"b":20}]`; the first query 
fails:
   
   ```
   java.lang.IllegalArgumentException: [items, list, element, a] required int32 
a = 4 is not in the store: [[id] required int32 id = 1] 1
        at 
org.apache.iceberg.shaded.org.apache.parquet.hadoop.ColumnChunkPageReadStore.getPageReader(ColumnChunkPageReadStore.java:388)
        at 
org.apache.iceberg.parquet.ParquetValueReaders$PresenceReader.setPageSource(ParquetValueReaders.java:411)
        at 
org.apache.iceberg.parquet.ParquetValueReaders$RepeatedReader.setPageSource(ParquetValueReaders.java:922)
        at 
org.apache.iceberg.parquet.ParquetValueReaders$StructReader.setPageSource(ParquetValueReaders.java:1203)
        at 
org.apache.iceberg.parquet.ParquetReader$FileIterator.advance(ParquetReader.java:169)
        at 
org.apache.iceberg.parquet.ParquetReader$FileIterator.next(ParquetReader.java:130)
        at org.apache.iceberg.spark.source.BaseReader.next(BaseReader.java:140)
        ...
   ```
   
   
   ### 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