Add contract-first Iceberg REST read-only support (Polaris-aligned codegen)#497
Closed
cbb330 wants to merge 3 commits intolinkedin:mainfrom
Closed
Add contract-first Iceberg REST read-only support (Polaris-aligned codegen)#497cbb330 wants to merge 3 commits intolinkedin:mainfrom
cbb330 wants to merge 3 commits intolinkedin:mainfrom
Conversation
- Replace hand-written OpenAPI spec with upstream Iceberg REST spec (iceberg-rest-catalog-open-api.yaml) following the Apache Polaris codegen pattern (importMappings/typeMappings, models=false) - Controller now implements generated CatalogApiApi and ConfigurationApiApi interfaces; unimplemented endpoints return 501 - Add prefix routing via /v1/config so REST client uses /v1/iceberg/namespaces/... (separate from /v1/databases/...) - Add IcebergRestHttpMessageConverter for Iceberg REST type serialization without interfering with existing Jackson converters - Add comprehensive round-trip integration tests (21 tests) using a real RESTCatalog client: schema fidelity, partitions, metadata, list tables, table exists, error handling, consistency - Update mock controller tests to use prefixed routes
17 tasks
16 tasks
Collaborator
Author
|
Superseded by a stacked PR series for easier review:
|
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
Supersedes #457.
Adds Phase 1 Iceberg REST Catalog support using contract-first codegen aligned with the Apache Polaris pattern. The server implements generated OpenAPI interfaces for read-only endpoints (
config,list tables,load table,table exists) with comprehensive round-trip integration tests.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
Codegen (Polaris-aligned)
spec/iceberg-rest-catalog-open-api.yamlimportMappings/typeMappingsmap spec schemas to real Iceberg types (no model generation)Object(compatibility with our 1.5.2 fork)CatalogApiApi+ConfigurationApiApiinterfacesSerialization
IcebergRestHttpMessageConverter— customAbstractHttpMessageConverter<RESTResponse>using Iceberg'sRESTSerializers(kebab-case JSON) without interfering with existing Jackson convertersIcebergRestSerdeConfig— registers the converter viaWebMvcConfigurer.extendMessageConvertersError Handling
IcebergRestExceptionHandler— scoped@RestControllerAdvicereturning IcebergErrorResponseformatTests
IcebergRestCatalogRoundTripTest(21 tests) — full round-trip integration tests using a real IcebergRESTCatalogclient:IcebergRestCatalogControllerTest(6 tests) — MockMvc unit tests for config, list, load, load not found, head exists, head not foundTesting Done
All 27 tests pass locally:
Additional Information
TODO: When Iceberg is upgraded to 1.7+, extend
CatalogTests<RESTCatalog>in round-trip tests (matching Polaris pattern).CatalogTestsis not available in our current 1.5.2 fork.