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

   ### What changes were proposed in this pull request?
   
   When loading an Iceberg format-version 3 table through the Gravitino API,
   map column defaults from Iceberg metadata into `Column.defaultValue()`:
   
   - Prefer Iceberg `write-default` (the value writers fill in).
   - Fall back to `initial-default` when `write-default` is unset.
   - Leave `Column.defaultValue()` unset when Iceberg has no convertible
     default.
   
   Conversion lives in `FromIcebergColumnDefault` and is wired through
   `ConvertUtil.fromNestedField` (used by table and view load paths).
   
   Creating or altering column defaults through the Gravitino API remains
   unsupported (`IcebergCatalogCapability.columnDefaultValue()` unchanged).
   
   ### Why are the changes needed?
   
   Fixes #14430
   
   Iceberg REST can store `initial-default` / `write-default` on v3 tables,
   but Gravitino's converter dropped them, so GET table returned columns
   without `defaultValue`.
   
   ### Does this PR introduce _any_ user-facing change?
   
   - Loading a format-version 3 Iceberg table that has column defaults now
     reports `defaultValue` (from `write-default`, else `initial-default`).
   - Docs: clarify that setting defaults via the Gravitino API is still
     unsupported, while read-back of Iceberg defaults is supported.
   
   ### How was this patch tested?
   
   - Unit tests in `TestConvertUtil`:
     - `testFromNestedFieldMapsWriteDefault`
     - `testFromNestedFieldFallsBackToInitialDefault`
   
   
   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