Add contract-first Iceberg REST read-only support (Polaris-aligned codegen)#457
Open
cbb330 wants to merge 3 commits intolinkedin:mainfrom
Open
Add contract-first Iceberg REST read-only support (Polaris-aligned codegen)#457cbb330 wants to merge 3 commits intolinkedin:mainfrom
cbb330 wants to merge 3 commits intolinkedin:mainfrom
Conversation
teamurko
previously approved these changes
Mar 10, 2026
| import org.springframework.web.bind.annotation.RestController; | ||
|
|
||
| /** | ||
| * Read-only Iceberg REST Catalog surface. |
Collaborator
There was a problem hiding this comment.
What does surface mean in this context?
- 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
9 tasks
Collaborator
Author
|
Superseded by #497 — rebased on latest main with contract-first codegen, upstream spec, and comprehensive round-trip tests. |
59a9742 to
2daee5b
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
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 using a real IcebergRESTCatalogclient.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
spec/iceberg-rest-catalog-open-api.yamlimportMappings/typeMappingsmap spec schemas to real Iceberg types following Polaris pattern (no model generation)Object(compatibility with our 1.5.2 fork)CatalogApiApi+ConfigurationApiApiinterfacesIcebergRestHttpMessageConverter— customAbstractHttpMessageConverter<RESTResponse>using Iceberg'sRESTSerializers(kebab-case JSON) without interfering with existing Jackson convertersIcebergRestSerdeConfig— registers the converter viaWebMvcConfigurer.extendMessageConvertersIcebergRestExceptionHandler— scoped@RestControllerAdvicereturning IcebergErrorResponseformatNew Features
Contract-first Iceberg REST read-only surface, compatible with stock Iceberg
RESTCatalog, PyIceberg, and DuckDB clients.Tests
IcebergRestCatalogRoundTripTest(21 tests) — round-trip integration tests using a real IcebergRESTCatalogclient: list tables (4), load table schema/partition/metadata (9), table exists HEAD (3), error handling (2), consistency (1), cross-namespace (2)IcebergRestCatalogControllerTest(6 tests) — MockMvc unit tests for config, list, load, load not found, head exists, head not foundTesting Done
All 27 tests pass locally:
Manual validation with PyIceberg:
Manual validation with DuckDB:
Additional Information
Note: When Iceberg is upgraded to 1.7+, the round-trip tests should extend
CatalogTests<RESTCatalog>with write tests disabled, matching the Polaris pattern.CatalogTestsis not available in our current 1.5.2 fork.