thswlsqls opened a new issue, #18033:
URL: https://github.com/apache/iceberg/issues/18033

   **Apache Iceberg version**
   main @ 9d7b2c52f
   
   **Query engine**
   None — the bug is in the MapReduce/Hive input format (`iceberg-mr`).
   
   **Please describe the bug**
   `IcebergInputFormat.IcebergRecordReader.openTask()` 
(`mr/src/main/java/org/apache/iceberg/mr/mapreduce/IcebergInputFormat.java` 
line 310) builds the reader without `idToConstant(...)`, so identity partition 
values recorded only in the manifest are never handed to the reader. Reading 
such a file returns `null` in the partition columns.
   
   This is a regression from a2802c44c (#15333), which merged the Avro, ORC and 
Parquet branches into one `ReadBuilder`. Before that change all three passed 
`constantsMap(task, IdentityPartitionConverters::convertConstant)`. The sibling 
reader touched by the same PR, 
`data/src/main/java/org/apache/iceberg/data/GenericReader.openFile()`, kept 
`.idToConstant(partition)`.
   
   **Steps to reproduce**
   1. Create an identity-partitioned table.
   2. Add a data file that does not physically contain the partition columns, 
with the partition values set on the manifest entry. 
`TableMigrationUtil.listPartition(...)` produces exactly this — it takes 
partition values from Hive metadata, not from the file — so any table imported 
with `add_files` or `migrate` is in this state.
   3. Read the table through `IcebergInputFormat`.
   
   Expected: the partition columns hold the manifest values. Actual: they are 
`null`.
   
   **Additional context**
   N/A
   


-- 
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