Iceberg REST Phase 1 [2/3]: Controller, serde, and exception handling#499
Open
cbb330 wants to merge 3 commits intolinkedin:mainfrom
Open
Iceberg REST Phase 1 [2/3]: Controller, serde, and exception handling#499cbb330 wants to merge 3 commits intolinkedin:mainfrom
cbb330 wants to merge 3 commits intolinkedin:mainfrom
Conversation
Vendor the upstream Apache Iceberg REST OpenAPI spec (v1.10) and wire Polaris-aligned codegen into the services/tables Gradle build: - spec/iceberg-rest-catalog-open-api.yaml: upstream spec as source of truth - Gradle tasks: setUpOpenApiCliForIcebergRest, validateIcebergRestOpenApiSpec, generateIcebergRestOpenApiServer with importMappings/typeMappings to map spec schemas to real Iceberg library types (no model generation) - Post-processing for Iceberg 1.10-only types mapped to Object (compatibility with our 1.5.2 fork) - compileJava depends on codegen; check depends on spec validation - jackson-databind-nullable dependency for generated code
This was referenced Mar 11, 2026
4816979 to
38ce9b7
Compare
- Strip non-upstream comments (CODE_COPIED_TO_POLARIS, version marker) so the vendored spec is byte-for-byte identical to apache-iceberg-1.10.0 - Add verifyIcebergRestSpecSync Gradle task that downloads the upstream spec from the pinned tag and fails if it differs from the vendored copy - Wire verifyIcebergRestSpecSync into the check task so CI catches drift
38ce9b7 to
85b9ba0
Compare
Implement the read-only Iceberg REST Catalog surface on top of the
generated OpenAPI interfaces from PR1:
Controller (IcebergRestCatalogController):
- Implements CatalogApiApi + ConfigurationApiApi generated interfaces
- GET /v1/config returns prefix override for route isolation
- GET /v1/{prefix}/namespaces/{ns}/tables lists tables via TablesService
- GET /v1/{prefix}/namespaces/{ns}/tables/{t} loads table via CatalogHandlers
- HEAD /v1/{prefix}/namespaces/{ns}/tables/{t} checks table existence
- All unimplemented endpoints return 501 via generated defaults
Serialization:
- IcebergRestHttpMessageConverter for Iceberg REST types (kebab-case JSON)
- IcebergRestSerde with Iceberg RESTSerializers + kebab-case ObjectMapper
- IcebergRestSerdeConfig registers converter without affecting existing Jackson
Error handling:
- IcebergRestExceptionHandler scoped to controller, returns Iceberg ErrorResponse
Service:
- TablesService.searchTables(databaseId, actingPrincipal) overload for auth
85b9ba0 to
c2161a8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part 2 of 3 for Iceberg REST Catalog support. Implements the read-only Iceberg REST surface on top of the generated OpenAPI interfaces from #498.
Changes
Client-facing API Changes
Adds read-only Iceberg REST Catalog endpoints via
IcebergRestCatalogController:GET /v1/config— returns prefix override (iceberg) for route isolationGET /v1/iceberg/namespaces/{namespace}/tables— list tablesGET /v1/iceberg/namespaces/{namespace}/tables/{table}— load table metadataHEAD /v1/iceberg/namespaces/{namespace}/tables/{table}— check table existenceAll unimplemented endpoints (write, namespace, views, etc.) return 501 via generated defaults.
Internal API Changes
Serialization:
IcebergRestHttpMessageConverter— customAbstractHttpMessageConverter<RESTResponse>using Iceberg'sRESTSerializers(kebab-case JSON) without interfering with existing Jackson convertersIcebergRestSerde— ObjectMapper configured with Iceberg serializers and kebab-caseIcebergRestSerdeConfig— registers converter viaWebMvcConfigurer.extendMessageConvertersError handling:
IcebergRestExceptionHandler— scoped@RestControllerAdvicereturning IcebergErrorResponseformat (no stack traces exposed)New Features
TablesService.searchTables(databaseId, actingPrincipal)overload for auth-checked table listingReview guidance
This PR's new files (316 lines across 7 files):
IcebergRestCatalogController.java(138 lines)IcebergRestExceptionHandler.java(64 lines)IcebergRestHttpMessageConverter.java(45 lines)IcebergRestSerde.java(33 lines)IcebergRestSerdeConfig.java(20 lines)TablesService.java(+9 lines)TablesServiceImpl.java(+7 lines)The diff against
mainalso includes #498's files — those are reviewed in that PR.Testing Done
Tests are in PR 3/3. This PR adds the implementation; 27 tests covering all endpoints are in the next PR.
Additional Information
PR Stack (merge in order)