This is an automated email from the ASF dual-hosted git repository.
adutra pushed a commit to branch feature/iceberg-1.11
in repository https://gitbox.apache.org/repos/asf/polaris.git
The following commit(s) were added to refs/heads/feature/iceberg-1.11 by this
push:
new e9d38a25a9 Add support for referenced-by
e9d38a25a9 is described below
commit e9d38a25a9bbb744680209b677a7a4d246a9a296
Author: Alexandre Dutra <[email protected]>
AuthorDate: Thu Mar 5 22:59:52 2026 +0100
Add support for referenced-by
---
.../catalog/iceberg/IcebergCatalogAdapter.java | 3 ++
.../IcebergRestCatalogEventServiceDelegator.java | 10 +++++--
.../admin/PolarisS3InteroperabilityTest.java | 1 +
.../service/catalog/io/FileIOExceptionsTest.java | 1 +
.../generated/bundled-polaris-catalog-service.yaml | 15 ++++++++++
spec/iceberg-rest-catalog-open-api.yaml | 35 ++++++++++++++++++++--
6 files changed, 61 insertions(+), 4 deletions(-)
diff --git
a/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogAdapter.java
b/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogAdapter.java
index e48990aa09..229b635b9c 100644
---
a/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogAdapter.java
+++
b/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogAdapter.java
@@ -323,6 +323,7 @@ public class IcebergCatalogAdapter
String accessDelegationMode,
String ifNoneMatchString,
String snapshots,
+ String referencedBy,
RealmContext realmContext,
SecurityContext securityContext) {
EnumSet<AccessDelegationMode> delegationModes =
@@ -522,6 +523,7 @@ public class IcebergCatalogAdapter
String namespace,
String table,
String planId,
+ String referencedBy,
RealmContext realmContext,
SecurityContext securityContext) {
Namespace ns = decodeNamespace(namespace);
@@ -548,6 +550,7 @@ public class IcebergCatalogAdapter
String prefix,
String namespace,
String view,
+ String referencedBy,
RealmContext realmContext,
SecurityContext securityContext) {
Namespace ns = decodeNamespace(namespace);
diff --git
a/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergRestCatalogEventServiceDelegator.java
b/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergRestCatalogEventServiceDelegator.java
index f4b75c57d5..bc51c278bb 100644
---
a/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergRestCatalogEventServiceDelegator.java
+++
b/runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergRestCatalogEventServiceDelegator.java
@@ -343,6 +343,7 @@ public class IcebergRestCatalogEventServiceDelegator
String accessDelegationMode,
String ifNoneMatchString,
String snapshots,
+ String referencedBy,
RealmContext realmContext,
SecurityContext securityContext) {
String catalogName = prefixParser.prefixToCatalogName(prefix);
@@ -366,6 +367,7 @@ public class IcebergRestCatalogEventServiceDelegator
accessDelegationMode,
ifNoneMatchString,
snapshots,
+ referencedBy,
realmContext,
securityContext);
@@ -629,6 +631,7 @@ public class IcebergRestCatalogEventServiceDelegator
String namespace,
String table,
String planId,
+ String referencedBy,
RealmContext realmContext,
SecurityContext securityContext) {
String catalogName = prefixParser.prefixToCatalogName(prefix);
@@ -642,7 +645,8 @@ public class IcebergRestCatalogEventServiceDelegator
.put(EventAttributes.NAMESPACE, namespaceObj)
.put(EventAttributes.TABLE_NAME, table)));
Response resp =
- delegate.loadCredentials(prefix, namespace, table, planId,
realmContext, securityContext);
+ delegate.loadCredentials(
+ prefix, namespace, table, planId, referencedBy, realmContext,
securityContext);
polarisEventListener.onEvent(
new PolarisEvent(
PolarisEventType.AFTER_LOAD_CREDENTIALS,
@@ -659,6 +663,7 @@ public class IcebergRestCatalogEventServiceDelegator
String prefix,
String namespace,
String view,
+ String referencedBy,
RealmContext realmContext,
SecurityContext securityContext) {
String catalogName = prefixParser.prefixToCatalogName(prefix);
@@ -671,7 +676,8 @@ public class IcebergRestCatalogEventServiceDelegator
.put(EventAttributes.CATALOG_NAME, catalogName)
.put(EventAttributes.NAMESPACE, namespaceObj)
.put(EventAttributes.VIEW_NAME, view)));
- Response resp = delegate.loadView(prefix, namespace, view, realmContext,
securityContext);
+ Response resp =
+ delegate.loadView(prefix, namespace, view, referencedBy, realmContext,
securityContext);
polarisEventListener.onEvent(
new PolarisEvent(
PolarisEventType.AFTER_LOAD_VIEW,
diff --git
a/runtime/service/src/test/java/org/apache/polaris/service/admin/PolarisS3InteroperabilityTest.java
b/runtime/service/src/test/java/org/apache/polaris/service/admin/PolarisS3InteroperabilityTest.java
index 6f849e3ada..7a2dda0ad9 100644
---
a/runtime/service/src/test/java/org/apache/polaris/service/admin/PolarisS3InteroperabilityTest.java
+++
b/runtime/service/src/test/java/org/apache/polaris/service/admin/PolarisS3InteroperabilityTest.java
@@ -182,6 +182,7 @@ public class PolarisS3InteroperabilityTest {
null,
null,
"ALL",
+ null,
services.realmContext(),
services.securityContext())) {
return response.readEntity(LoadTableResponse.class);
diff --git
a/runtime/service/src/test/java/org/apache/polaris/service/catalog/io/FileIOExceptionsTest.java
b/runtime/service/src/test/java/org/apache/polaris/service/catalog/io/FileIOExceptionsTest.java
index 3dba4a5f14..ff5f9d85fc 100644
---
a/runtime/service/src/test/java/org/apache/polaris/service/catalog/io/FileIOExceptionsTest.java
+++
b/runtime/service/src/test/java/org/apache/polaris/service/catalog/io/FileIOExceptionsTest.java
@@ -166,6 +166,7 @@ public class FileIOExceptionsTest {
null,
null,
"ALL",
+ null,
services.realmContext(),
services.securityContext());
res.close();
diff --git a/spec/generated/bundled-polaris-catalog-service.yaml
b/spec/generated/bundled-polaris-catalog-service.yaml
index 53cbe35bcf..c580a237fb 100644
--- a/spec/generated/bundled-polaris-catalog-service.yaml
+++ b/spec/generated/bundled-polaris-catalog-service.yaml
@@ -582,6 +582,7 @@ paths:
enum:
- all
- refs
+ - $ref: '#/components/parameters/referenced-by'
responses:
'200':
$ref: '#/components/responses/LoadTableResponse'
@@ -787,6 +788,7 @@ paths:
schema:
type: string
description: The plan ID that has been used for server-side scan
planning
+ - $ref: '#/components/parameters/referenced-by'
description: Load vended credentials for a table from the catalog.
responses:
'200':
@@ -1108,6 +1110,8 @@ paths:
The response also contains the view's full metadata, matching the view
metadata JSON file.
The catalog configuration may contain credentials that should be used
for subsequent requests for the view. The configuration key "token" is used to
pass an access token to be used as a bearer token for view requests. Otherwise,
a token may be passed using a RFC 8693 token type as a configuration key. For
example, "urn:ietf:params:oauth:token-type:jwt=<JWT-token>".
+ parameters:
+ - $ref: '#/components/parameters/referenced-by'
responses:
'200':
$ref: '#/components/responses/LoadViewResponse'
@@ -4534,6 +4538,17 @@ components:
schema:
type: string
example: sales
+ referenced-by:
+ name: referenced-by
+ in: query
+ description: |-
+ A comma-separated list of fully qualified view names (namespace and
view name) representing the view reference chain when an entity (table or view)
is loaded via a view. The list should be ordered with the outermost view first,
followed by any intermediate views it references, down to the view that
directly references the entity. For a simple case where a view directly
references the entity, the list contains a single view identifier. For nested
views (a view referencing another [...]
+ The view identifier is a composite string of the format
{namespace}{separator}{viewName}. The namespace-separator (defined in /config)
acts as the delimiter. When parsing, the last occurrence of this separator
identifies the boundary between the namespace and the view name. Multipart
namespaces must follow the encoding rules of the parent parameter in the list
namespaces endpoint.
+ Multiple view identifiers are separated by commas. Servers should
split the parameter value on comma characters to parse individual view
identifiers. If view names contain commas, they must be url-encoded as %2C.
+ Example with multiple views (where prod%1Fanalytics is a nested
namespace which has a quarterly_view which references to monthly_view which
then references the entity being loaded) -
prod%1Fanalytics%1Fquarterly_view,prod%1Fanalytics%1Fmonthly_view
+ required: false
+ schema:
+ type: string
view:
name: view
in: path
diff --git a/spec/iceberg-rest-catalog-open-api.yaml
b/spec/iceberg-rest-catalog-open-api.yaml
index 50ed54a6a4..6c89b01a1f 100644
--- a/spec/iceberg-rest-catalog-open-api.yaml
+++ b/spec/iceberg-rest-catalog-open-api.yaml
@@ -20,7 +20,7 @@
# CODE_COPIED_TO_POLARIS
# Apache Iceberg Version: 1.11.0
-# commit SHA: 459332131f429484177d45acabea8903a45acc4e
+# commit SHA: ed8a16bbeb549b0286d3c229beb5a0cf165f2f4b
---
openapi: 3.1.1
@@ -32,7 +32,7 @@ info:
version: 0.0.1
description:
Defines the specification for the first version of the REST Catalog API.
- Implementations should ideally support both Iceberg table specs v1 and v2,
with priority given to v2.
+ Implementations should ideally support all Iceberg table spec versions.
servers:
- url: "{scheme}://{host}/{basePath}"
description: Server URL when the port can be inferred from the scheme
@@ -623,6 +623,7 @@ paths:
- $ref: '#/components/parameters/prefix'
- $ref: '#/components/parameters/namespace'
- $ref: '#/components/parameters/table'
+ - $ref: '#/components/parameters/data-access'
post:
tags:
- Catalog API
@@ -712,6 +713,7 @@ paths:
- $ref: '#/components/parameters/namespace'
- $ref: '#/components/parameters/table'
- $ref: '#/components/parameters/plan-id'
+ - $ref: '#/components/parameters/data-access'
get:
tags:
@@ -986,6 +988,7 @@ paths:
schema:
type: string
enum: [ all, refs ]
+ - $ref: '#/components/parameters/referenced-by'
responses:
200:
$ref: '#/components/responses/LoadTableResponse'
@@ -1228,6 +1231,7 @@ paths:
schema:
type: string
description: The plan ID that has been used for server-side scan
planning
+ - $ref: '#/components/parameters/referenced-by'
description: Load vended credentials for a table from the catalog.
responses:
200:
@@ -1592,6 +1596,8 @@ paths:
view. The configuration key "token" is used to pass an access token to
be used as a bearer token
for view requests. Otherwise, a token may be passed using a RFC 8693
token type as a configuration
key. For example, "urn:ietf:params:oauth:token-type:jwt=<JWT-token>".
+ parameters:
+ - $ref: '#/components/parameters/referenced-by'
responses:
200:
$ref: '#/components/responses/LoadViewResponse'
@@ -2011,6 +2017,31 @@ components:
schema:
type: string
+ referenced-by:
+ name: referenced-by
+ in: query
+ description:
+ A comma-separated list of fully qualified view names (namespace and
view name) representing the view
+ reference chain when an entity (table or view) is loaded via a view.
The list should be ordered with the outermost view
+ first, followed by any intermediate views it references, down to the
view that directly references the entity.
+ For a simple case where a view directly references the entity, the
list contains a single view identifier.
+ For nested views (a view referencing another view which references the
entity), the list contains multiple
+ view identifiers representing the complete dependency chain.
+
+ The view identifier is a composite string of the format
{namespace}{separator}{viewName}.
+ The namespace-separator (defined in /config) acts as the delimiter.
+ When parsing, the last occurrence of this separator identifies the
boundary between the namespace and the view name.
+ Multipart namespaces must follow the encoding rules of the parent
parameter in the list namespaces endpoint.
+
+ Multiple view identifiers are separated by commas. Servers should
split the parameter value on comma characters
+ to parse individual view identifiers. If view names contain commas,
they must be url-encoded as %2C.
+
+ Example with multiple views (where prod%1Fanalytics is a nested
namespace which has a quarterly_view which references to monthly_view
+ which then references the entity being loaded) -
prod%1Fanalytics%1Fquarterly_view,prod%1Fanalytics%1Fmonthly_view
+ required: false
+ schema:
+ type: string
+
idempotency-key:
name: Idempotency-Key
in: header