Anurag-S1ngh opened a new pull request, #19289: URL: https://github.com/apache/iceberg/pull/19289
## Summary - `compute_table_stats` resolved requested columns only against the snapshot's schema. After a rename with no following commit, the snapshot schema still has the old name, so the new name is rejected. When two columns swap names, it can compute statistics for the wrong field ID. - Resolve each requested name against the snapshot schema first, preserving behavior for historical snapshots, then fall back to the current table schema and map the current field ID back to the snapshot schema. Columns absent from the snapshot are still rejected. ## Changes - `ComputeTableStatsSparkAction` in Spark 3.5, 4.0, 4.1, and 4.2: replace name validation with resolution that returns the snapshot-schema names used for reads and blob metadata. - Add a Spark 4.2 test for a rename with no new snapshot, asserting the blob is written for the renamed field ID. ## Testing - `./gradlew ":iceberg-spark:iceberg-spark-4.2_2.13:test" --tests "org.apache.iceberg.spark.actions.TestComputeTableStatsAction"` passes. - The new test fails before the change with `Can't find column data2 in table`. - `spotlessApply` run for Spark 4.2. - Spark 3.5, 4.0, and 4.1 are not enabled in this checkout; their copies are identical and use only existing `Schema` APIs. Closes #19287 -- 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]
