lasdf1234 opened a new pull request, #14552:
URL: https://github.com/apache/gravitino/pull/14552

   ### What changes were proposed in this pull request?
   
   - When `use-snapshot-schema` is false (REST default) and a `snapshot-id` is 
set, rewrite filter/select/stats field names from the current table schema to 
the snapshot schema by Iceberg field id before `useSnapshot`, so branch scans 
bind against current names.
   - Sanitize `specs-by-id` used in plan responses when an older partition 
spec's source column was dropped (`partitionType` contains `unknown`), 
restoring types from `PartitionData` so file-scan-task serialization succeeds.
   
   ### Why are the changes needed?
   
   Fixes #14536. Iceberg's Java REST client sends `use-snapshot-schema: false` 
for branch scans; ignoring it caused 500 `Cannot find field` after renames. 
Separately, plan serialization threw `Type: unknown is not supported` as 
text/plain 400 for valid tables after partition evolution + drop.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. `POST .../plan` with `use-snapshot-schema: false` now binds 
filter/select to the current schema as specified. Tables whose historical specs 
reference dropped columns can be planned successfully instead of failing with a 
bare text/plain 400.
   
   ### How was this patch tested?
   
   - `./gradlew :iceberg:iceberg-rest-server:test --tests 
'org.apache.gravitino.iceberg.service.TestScanPlanSupport' -PskipITs 
-PskipWeb=true`
   
   
   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]

Reply via email to