markhoerth opened a new pull request, #14546: URL: https://github.com/apache/gravitino/pull/14546
### What changes were proposed in this pull request? - `IcebergCommitValidation.assignPartitionFieldIds`, called from `CatalogWrapperForREST.updateTable`: an `add-spec` field without a `field-id` gets the id of the same field (source and transform) in an earlier spec, or the next id above `last-partition-id`, from the table's current metadata. Creates and requests whose fields all carry ids are unchanged and load no metadata. The commit validation still checks the result on every retry, so a concurrent change that takes the id is refused. - The schema check allows `date` to `timestamp` and `timestamp_ns` (without time zone) on v3 tables, as the v3 table spec does. - `IcebergColumnFieldValidator` checks every decimal type, nested ones included, with Gravitino's own `Types.DecimalType` rule before a create, register or schema commit, so nothing is created that cannot be imported. ### Why are the changes needed? A valid `add-spec` was refused, valid v3 promotions were refused, and an invalid decimal left a created, unowned table behind a 400. Fixes #14545 ### Does this PR introduce _any_ user-facing change? Yes. `add-spec` without field ids succeeds with correctly numbered ids; v3 date promotions are accepted; a create with a decimal Gravitino cannot represent is refused with 400 before anything is created. ### How was this patch tested? - `TestIcebergCommitValidation#testAddSpecWithoutFieldIdsGetsTheTablesIds`, `#testAddSpecWithFieldIdsIsUnchanged`, `#testDatePromotionsAreAllowedOnlyFromV3`. - `TestIcebergTableOperationExecutor#testRejectsUnrepresentableDecimalBeforeCreate`. - The issue's curl reproduction, which fails before this change. `./gradlew :iceberg:iceberg-rest-server:test -PskipITs` 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Eu6fb9pLfmrSJzGQDVLi1g -- 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]
