lasdf1234 opened a new pull request, #14796: URL: https://github.com/apache/gravitino/pull/14796
## What changes were proposed in this pull request? Drop IRC's empty-table `hasData` gate so `AddSchema` validation (type promotion, optional→required, required field without default) applies even when the table has no snapshots, matching Iceberg Table Spec / `UpdateSchema` and the Gravitino API path. Replace (`RemoveSnapshotRef(main)`) and staged create remain exempt from evolution checks and still succeed. ## Why are the changes needed? Previously IRC skipped incompatible schema checks when `base.snapshots()` was empty. That diverged from Iceberg `SchemaUpdate` (no empty-table exemption unless `allowIncompatibleChanges()`) and from Gravitino API behavior. Empty-table clients that relied on 200 for illegal evolutions will now get 4xx. Split out of #14751 per review: this is a compatibility/behavior change, not a pure client-error→4xx mapping fix. Fixes #14429 ## Does this PR introduce _any_ user-facing change? Yes. Empty-table schema evolution that was previously accepted may now return 4xx. Create-then-replace / staged create that remove `main` (or assert table does not exist) still work. ## How was this patch tested? - `TestIcebergCommitValidation` (including empty-table evolution rejection, empty replace redefine, staged create) - `TestIcebergTableOperations` fixture update for optional replacement column Made with [Cursor](https://cursor.com) -- 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]
