nevzheng opened a new pull request, #11957:
URL: https://github.com/apache/gravitino/pull/11957
### What changes were proposed in this pull request?
Surface `format-version` as a first-class, validated Iceberg table property
(builds on the native `variant` type from #11932):
- Typed as an integer restricted to `{2, 3}`; other values are rejected at
the Gravitino layer with a clear message.
- Gravitino owns the default and stamps `2` when the value is unset or empty
(`empty → 2`, `2 → 2`, `3 → 3`). Setting `3` is what enables V3 types such as
`variant`.
- Unit tests (property validation + create-property resolution) and REST/IRC
integration tests that create a `variant` column through the Gravitino API at
`format-version` 3 and read it back.
- Docs: the catalog property table plus two OpenAPI create examples
(`IcebergTableCreate` v2, `IcebergVariantTableCreate` v3).
### Why are the changes needed?
Creating a `variant` column (the V3 type added in #11932) requires the table
at Iceberg format-version 3. `format-version` was previously an unvalidated
free-form string with no default, so a variant create failed with a low-level
Iceberg error, and nothing covered the write path to a REST/IRC backend.
Fixes #11954. Related to #11949 (the umbrella tracking issue for the whole
variant feature).
### Does this PR introduce _any_ user-facing change?
- The `format-version` Iceberg table property is now validated — allowed
values `2`/`3`, unset/empty defaults to `2`, others rejected with a clear error.
- New OpenAPI examples for creating Iceberg tables.
### How was this patch tested?
- Unit tests: property validation (default, valid/invalid, empty) and
create-property mapping (`absent/""/2/3`).
- Integration tests (REST/IRC): variant column created via the Gravitino API
at v3 and read back; variant-without-v3 rejected; unset/`2`/empty resolve to
`2`.
- Verified end-to-end in the Gravitino playground against an Iceberg REST
catalog (read back over the `/iceberg` endpoint).
- `./gradlew :docs:build` validates the OpenAPI spec.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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]