Skip to content

REST: Allow struct default values in schema fields#16612

Open
akashmalbari wants to merge 2 commits into
apache:mainfrom
akashmalbari:fix-rest-struct-default-values-16596
Open

REST: Allow struct default values in schema fields#16612
akashmalbari wants to merge 2 commits into
apache:mainfrom
akashmalbari:fix-rest-struct-default-values-16596

Conversation

@akashmalbari
Copy link
Copy Markdown

Fixes #16596.

This updates REST/OpenAPI schema field default handling so initial-default and write-default can represent valid Iceberg struct defaults such as {}.

The change keeps expression literal values restricted to primitive values while allowing schema field defaults to use the broader default-value representation required by the Iceberg v3 spec.

Added regression coverage for:

  • struct field defaults represented as {}
  • nested field defaults inside that struct
  • round-tripping schema/default JSON
  • REST create-table/schema parsing with struct defaults

Validation:

  • JAVA_HOME=/opt/homebrew/Cellar/openjdk@17/17.0.19/libexec/openjdk.jdk/Contents/Home ./gradlew :iceberg-core:test --tests org.apache.iceberg.TestSchemaParser --tests org.apache.iceberg.rest.requests.TestCreateTableRequest --stacktrace
  • JAVA_HOME=/opt/homebrew/Cellar/openjdk@17/17.0.19/libexec/openjdk.jdk/Contents/Home ./gradlew :iceberg-open-api:check --stacktrace
  • JAVA_HOME=/opt/homebrew/Cellar/openjdk@17/17.0.19/libexec/openjdk.jdk/Contents/Home ./gradlew spotlessApply
  • JAVA_HOME=/opt/homebrew/Cellar/openjdk@17/17.0.19/libexec/openjdk.jdk/Contents/Home ./gradlew spotlessCheck

@nssalian
Copy link
Copy Markdown
Contributor

@akashmalbari thanks for contributing the fix. Please get CI to a healthy state. Happy to review soon after.

@akashmalbari
Copy link
Copy Markdown
Author

Thanks! I’m looking into the failing CI now and will push a follow-up shortly.

@akashmalbari
Copy link
Copy Markdown
Author

Thanks! I pushed a follow-up regenerating open-api/rest-catalog-open-api.py.

The OpenAPI spec validates locally with:
cd open-api && make lint && make generate

The Kafka Connect failure appears unrelated to this PR: it failed while resolving dependencies from Maven Central with HTTP 403 responses.

The CI is in a healthy state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

initial-default+write-default {} (struct default value) representation issue

2 participants