DerGut opened a new issue, #19109: URL: https://github.com/apache/iceberg/issues/19109
### Apache Iceberg version 1.12.0 (latest release) ### Query engine None ### Please describe the bug 🐞 Scan reports contain a `schema_id`. When a scan uses a reducing projection, that id gets set to `0` and may refer to an outdated schema. The [`TypeUtil.project()`](https://github.com/apache/iceberg/blob/4e61757dcf568051a13bb8d4c00ef57c9f248947/api/src/main/java/org/apache/iceberg/types/TypeUtil.java#L59-L72) function creates and returns a new `Schema` with its `schameId` set to the [`DEFAULT_SCHEMA_ID = 0`](https://github.com/apache/iceberg/blob/69a3d2b560ac8ad20eaf995625639a43a1be3254/api/src/main/java/org/apache/iceberg/Schema.java#L59). The result is directly used to build the scan report. I could see two ways to work around this: 1. use the `schemaId` from which the projection was derived from 2. use `null` Both approaches have different pros and cons and would be good to know what users are actually using the `schemaId` of a report for, to make the call here. I'm leaning to think that 1. is more informative than 2. and the fact that a projection was used can be derived from the other report fields `projected_field_names`/ `projected_field_ids`. So a user would know the source schema and the projection. With `null`, they would only know the projection, but not which schema was used - well they could still derive it from the `snapshot_id`. ### 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 - [ ] 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]
