You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@polaris.apache.org by "poojanilangekar (via GitHub)" <gi...@apache.org> on 2025/08/06 22:31:24 UTC
[PR] Add a regression test for Catalog Federation [polaris]
poojanilangekar opened a new pull request, #2286:
URL: https://github.com/apache/polaris/pull/2286
This change adds a PR to test the end-to-end catalog federation functionality.
Steps involved:
1. Create a `new-user` account.
2. Create an `INTERNAL` catalog, called `test-catalog-local`.
3. Grant the following privileges on `test-catalog-local` :`TABLE_WRITE_DATA` -> `catalog_admin` -> `service_admin` -> `new-user`.
4. Create an `EXTERNAL` catalog called `test-catalog-external` that points to `test-catalog-local` and uses the client-id and client-secret credentials for the `new_user` account.
5. Grant the following privileges on `test-catalog-external` :`TABLE_WRITE_DATA` -> `catalog_admin` -> `service_admin`.
6. Connect to `test-catalog-local` and use it to create namespaces/tables and insert some data.
7. Connect to `test-catalog-external` and select the existing data and insert new rows.
8. Re-connect to `test-catalog-local` and verify that the changes made in `test-catalog-external` are visible.
This change disables URL overlap check since we are federating to a single Polaris instance.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add a regression test for Catalog Federation [polaris]
Posted by "snazy (via GitHub)" <gi...@apache.org>.
snazy commented on PR #2286:
URL: https://github.com/apache/polaris/pull/2286#issuecomment-3182932510
I'm not against this PR in principle, however it was mentioned that "we'll need docker-based regression tests". I do think that the state of the regression tests as of today. do nothing that could not be done in a Java based integration test.
OTOH, playing devil's advocate here, do we have good enough JUnit (integration) test coverage for federation?
Another devil: are the regression tests actually really testing a "full black box end to end test" including all the things that end users do (real database, external IdP, secured Polaris setup, external x/y/z)?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add a regression test for Catalog Federation [polaris]
Posted by "snazy (via GitHub)" <gi...@apache.org>.
snazy commented on PR #2286:
URL: https://github.com/apache/polaris/pull/2286#issuecomment-3178975998
Having tests for more complex setups is totally legit. I just don't think that containers are are a requirement for that.
This is where for example https://github.com/apache/polaris-tools/pull/18 comes into play - it runs a Polaris server (actually "anything Quarkus") from the "local" code base or a specific distributed/released version, which you can then use in an integration test to test the federation use case.
From a machine resource usage it's even more lightweight as only the processes are run, but no container infra.
And you'd be able to run it from your IDE and, with some option tweaking, can debug the processes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add a regression test for Catalog Federation [polaris]
Posted by "dennishuo (via GitHub)" <gi...@apache.org>.
dennishuo merged PR #2286:
URL: https://github.com/apache/polaris/pull/2286
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add a regression test for Catalog Federation [polaris]
Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on PR #2286:
URL: https://github.com/apache/polaris/pull/2286#issuecomment-3176358851
From my POV running docker-based tests is more cumbersome than running JUnit5-based tests. So, if the same functionality can be tested under the JUnit framework, I'd prefer that approach.
I do not oppose merging this PR, but I believe it too heavy for the job it performs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add a regression test for Catalog Federation [polaris]
Posted by "dennishuo (via GitHub)" <gi...@apache.org>.
dennishuo commented on PR #2286:
URL: https://github.com/apache/polaris/pull/2286#issuecomment-3189494302
Yeah, I agree the "Docker" discussion is worth expanding in another thread, even though it's orthogonal to this PR. I'm definitely also in favor of supporting the non-Docker scenarios like running the server in an IDE or anywhere else and still being able to run tests against those, and we can make sure the structure of regtests continues supporting that pattern.
Also +1 to expanding the black-box testing scope to really exercise the things a real user will do; having this PR as a starting point will hopefully reduce the barrier of entry for folks interested in exercising those complex scenarios.
Since it sounds like no one is opposed to merging this PR, I'll go ahead and merge it to unblock expanding test coverage.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add a regression test for Catalog Federation [polaris]
Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on PR #2286:
URL: https://github.com/apache/polaris/pull/2286#issuecomment-3176938631
@dimas-b I agree that should add more integration tests on top of this , but we'll need docker-based regression tests for federation in general (imagine testing federation to Hive, you need to actually run HMS somewhere). Accordingly I think it's okay or even prudent to have a regression test for IRC federation for the sake of parity.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add a regression test for Catalog Federation [polaris]
Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #2286:
URL: https://github.com/apache/polaris/pull/2286#discussion_r2263610027
##########
regtests/t_catalog_federation/src/catalog_federation.sh:
##########
@@ -0,0 +1,196 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# This test creates an INTERNAL catalog and an EXTERNAL catalog with passthrough facade
+# to demonstrate true catalog federation.
+
+set -e
+
+
+SPARK_BEARER_TOKEN="${REGTEST_ROOT_BEARER_TOKEN}"
+
+echo "=== Setting up Catalog Federation Test ==="
+
+# Step 1: Create a new principal
+echo "Creating new principal..."
+PRINCIPAL_RESPONSE=$(curl -s -X POST -H "Authorization: Bearer ${SPARK_BEARER_TOKEN}" -H 'Content-Type: application/json' \
+ http://${POLARIS_HOST:-localhost}:8181/api/management/v1/principals \
+ -d '{
+ "principal": {
+ "name": "new-user"
+ }
+ }')
+
+NEW_CLIENT_ID=$(echo "$PRINCIPAL_RESPONSE" | jq -r '.credentials.clientId')
+NEW_CLIENT_SECRET=$(echo "$PRINCIPAL_RESPONSE" | jq -r '.credentials.clientSecret')
+
+# Step 2: Create local catalog
+echo "Creating local catalog..."
+RESPONSE_CODE=$(curl -s -X POST -H "Authorization: Bearer ${SPARK_BEARER_TOKEN}" -H 'Content-Type: application/json' \
+ http://${POLARIS_HOST:-localhost}:8181/api/management/v1/catalogs \
+ -d '{
+ "type": "INTERNAL",
+ "name": "test-catalog-local",
+ "properties": {
+ "default-base-location": "file:///tmp/warehouse"
+ },
+ "storageConfigInfo": {
+ "storageType": "FILE",
+ "allowedLocations": ["file:///tmp/warehouse"]
+ }
+ }' \
+ --write-out "%{http_code}")
+echo "Create local catalog response code: $RESPONSE_CODE"
+
+
+
+# Step 3: Grant permissions
+echo "Setting up permissions..."
+
+# Grant TABLE_WRITE_DATA privilege to catalog_admin for local catalog
+RESPONSE_CODE=$(curl -s -X PUT -H "Authorization: Bearer ${SPARK_BEARER_TOKEN}" -H 'Accept: application/json' -H 'Content-Type: application/json' \
+ http://${POLARIS_HOST:-localhost}:8181/api/management/v1/catalogs/test-catalog-local/catalog-roles/catalog_admin/grants \
+ -d '{"type": "catalog", "privilege": "TABLE_WRITE_DATA"}' \
+ --write-out "%{http_code}")
+echo "Grant TABLE_WRITE_DATA to catalog_admin response code: $RESPONSE_CODE"
+
+# Assign catalog_admin to service_admin
+RESPONSE_CODE=$(curl -s -X PUT -H "Authorization: Bearer ${SPARK_BEARER_TOKEN}" -H 'Accept: application/json' -H 'Content-Type: application/json' \
+ http://${POLARIS_HOST:-localhost}:8181/api/management/v1/principal-roles/service_admin/catalog-roles/test-catalog-local \
+ -d '{"name": "catalog_admin"}' \
+ --write-out "%{http_code}")
+echo "Assign catalog_admin to service_admin response code: $RESPONSE_CODE"
+
+# Assign service_admin to new-user
+RESPONSE_CODE=$(curl -s -X PUT -H "Authorization: Bearer ${SPARK_BEARER_TOKEN}" -H 'Accept: application/json' -H 'Content-Type: application/json' \
+ http://${POLARIS_HOST:-localhost}:8181/api/management/v1/principals/new-user/principal-roles \
+ -d '{"name": "service_admin"}' \
+ --write-out "%{http_code}")
+echo "Assign service_admin to new-user response code: $RESPONSE_CODE"
+
+# Step 4: Create external catalog
+echo "Creating external catalog (passthrough facade)..."
+RESPONSE_CODE=$(curl -s -X POST -H "Authorization: Bearer ${SPARK_BEARER_TOKEN}" -H 'Content-Type: application/json' \
+ http://${POLARIS_HOST:-localhost}:8181/api/management/v1/catalogs \
+ -d "{
+ \"type\": \"EXTERNAL\",
+ \"name\": \"test-catalog-external\",
+ \"connectionConfigInfo\": {
+ \"connectionType\": \"ICEBERG_REST\",
+ \"uri\": \"http://${POLARIS_HOST:-localhost}:8181/api/catalog\",
+ \"remoteCatalogName\": \"test-catalog-local\",
+ \"authenticationParameters\": {
+ \"authenticationType\": \"OAUTH\",
+ \"tokenUri\": \"http://${POLARIS_HOST:-localhost}:8181/api/catalog/v1/oauth/tokens\",
+ \"clientId\": \"${NEW_CLIENT_ID}\",
+ \"clientSecret\": \"${NEW_CLIENT_SECRET}\",
+ \"scopes\": [\"PRINCIPAL_ROLE:ALL\"]
+ }
+ },
+ \"properties\": {
+ \"default-base-location\": \"file:///tmp/warehouse\"
+ },
+ \"storageConfigInfo\": {
+ \"storageType\": \"FILE\",
+ \"allowedLocations\": [\"file:///tmp/warehouse\"]
+ }
+ }" \
+ --write-out "%{http_code}")
+echo "Create external catalog response code: $RESPONSE_CODE"
+
+# Step 5: Grant permissions for external catalog
+echo "Setting up permissions for external catalog..."
+
+# Grant TABLE_WRITE_DATA privilege to catalog_admin role for test-catalog-external
+RESPONSE_CODE=$(curl -s -X PUT -H "Authorization: Bearer ${SPARK_BEARER_TOKEN}" -H 'Accept: application/json' -H 'Content-Type: application/json' \
+ http://${POLARIS_HOST:-localhost}:8181/api/management/v1/catalogs/test-catalog-external/catalog-roles/catalog_admin/grants \
+ -d '{"type": "catalog", "privilege": "TABLE_WRITE_DATA"}' \
+ --write-out "%{http_code}")
+echo "Grant TABLE_WRITE_DATA to external catalog_admin response code: $RESPONSE_CODE"
+
+# Assign catalog_admin role to service_admin principal-role for test-catalog-external
+RESPONSE_CODE=$(curl -s -X PUT -H "Authorization: Bearer ${SPARK_BEARER_TOKEN}" -H 'Accept: application/json' -H 'Content-Type: application/json' \
+ http://${POLARIS_HOST:-localhost}:8181/api/management/v1/principal-roles/service_admin/catalog-roles/test-catalog-external \
+ -d '{"name": "catalog_admin"}' \
+ --write-out "%{http_code}")
+echo "Assign catalog_admin to service_admin for external catalog response code: $RESPONSE_CODE"
+
+echo "Catalogs created successfully"
+
+echo ""
+echo "=== Starting federation test ==="
+
+# Test data operations via local catalog
+echo "=== Creating data via LOCAL catalog ==="
+cat << EOF | ${SPARK_HOME}/bin/spark-sql -S --conf spark.sql.catalog.polaris.token="${SPARK_BEARER_TOKEN}" --conf spark.sql.catalog.polaris.warehouse=test-catalog-local --conf spark.sql.defaultCatalog=polaris --conf spark.sql.extensions=org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions
+use polaris;
+create namespace if not exists ns1;
+create table if not exists ns1.test_table (id int, name string);
+insert into ns1.test_table values (1, 'Alice');
+insert into ns1.test_table values (2, 'Bob');
+create namespace if not exists ns2;
+create table if not exists ns2.test_table (id int, name string);
+insert into ns2.test_table values (1, 'Apache Spark');
+insert into ns2.test_table values (2, 'Apache Iceberg');
+EOF
+
+echo ""
+echo "=== Accessing data via EXTERNAL catalog ==="
+cat << EOF | ${SPARK_HOME}/bin/spark-sql -S --conf spark.sql.catalog.polaris.token="${SPARK_BEARER_TOKEN}" --conf spark.sql.catalog.polaris.warehouse=test-catalog-external --conf spark.sql.defaultCatalog=polaris --conf spark.sql.extensions=org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions
+use polaris;
+show namespaces;
+select * from ns1.test_table order by id;
+insert into ns1.test_table values (3, 'Charlie');
+select * from ns2.test_table order by id;
+insert into ns2.test_table values (3, 'Apache Polaris');
+EOF
+
+echo ""
+echo "=== Verifying federation via LOCAL catalog ==="
Review Comment:
Can we do some verification of RBAC as well?
##########
regtests/README.md:
##########
@@ -85,6 +85,15 @@ project, just run:
env POLARIS_HOST=localhost ./regtests/run.sh
```
+The catalog federation tests rely on the following configurations in `application.properties` to
+be set in order to succeed.
+
+```
+polaris.features."SUPPORTED_CATALOG_STORAGE_TYPES"=["S3","GCS","AZURE", "FILE"]
Review Comment:
super nit:
```suggestion
polaris.features."SUPPORTED_CATALOG_STORAGE_TYPES"=["S3","GCS","AZURE","FILE"]
```
##########
regtests/README.md:
##########
@@ -85,6 +85,15 @@ project, just run:
env POLARIS_HOST=localhost ./regtests/run.sh
```
+The catalog federation tests rely on the following configurations in `application.properties` to
+be set in order to succeed.
+
+```
+polaris.features."SUPPORTED_CATALOG_STORAGE_TYPES"=["S3","GCS","AZURE", "FILE"]
Review Comment:
And `ALLOW_INSECURE_STORAGE_TYPES`
##########
regtests/README.md:
##########
@@ -85,6 +85,15 @@ project, just run:
env POLARIS_HOST=localhost ./regtests/run.sh
```
+The catalog federation tests rely on the following configurations in `application.properties` to
+be set in order to succeed.
+
+```
+polaris.features."SUPPORTED_CATALOG_STORAGE_TYPES"=["S3","GCS","AZURE", "FILE"]
Review Comment:
Do we not also rely on `readiness.ignore-severe-issues`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add a regression test for Catalog Federation [polaris]
Posted by "poojanilangekar (via GitHub)" <gi...@apache.org>.
poojanilangekar commented on code in PR #2286:
URL: https://github.com/apache/polaris/pull/2286#discussion_r2263753246
##########
regtests/t_catalog_federation/src/catalog_federation.sh:
##########
@@ -0,0 +1,196 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# This test creates an INTERNAL catalog and an EXTERNAL catalog with passthrough facade
+# to demonstrate true catalog federation.
+
+set -e
+
+
+SPARK_BEARER_TOKEN="${REGTEST_ROOT_BEARER_TOKEN}"
+
+echo "=== Setting up Catalog Federation Test ==="
+
+# Step 1: Create a new principal
+echo "Creating new principal..."
+PRINCIPAL_RESPONSE=$(curl -s -X POST -H "Authorization: Bearer ${SPARK_BEARER_TOKEN}" -H 'Content-Type: application/json' \
+ http://${POLARIS_HOST:-localhost}:8181/api/management/v1/principals \
+ -d '{
+ "principal": {
+ "name": "new-user"
+ }
+ }')
+
+NEW_CLIENT_ID=$(echo "$PRINCIPAL_RESPONSE" | jq -r '.credentials.clientId')
+NEW_CLIENT_SECRET=$(echo "$PRINCIPAL_RESPONSE" | jq -r '.credentials.clientSecret')
+
+# Step 2: Create local catalog
+echo "Creating local catalog..."
+RESPONSE_CODE=$(curl -s -X POST -H "Authorization: Bearer ${SPARK_BEARER_TOKEN}" -H 'Content-Type: application/json' \
+ http://${POLARIS_HOST:-localhost}:8181/api/management/v1/catalogs \
+ -d '{
+ "type": "INTERNAL",
+ "name": "test-catalog-local",
+ "properties": {
+ "default-base-location": "file:///tmp/warehouse"
+ },
+ "storageConfigInfo": {
+ "storageType": "FILE",
+ "allowedLocations": ["file:///tmp/warehouse"]
+ }
+ }' \
+ --write-out "%{http_code}")
+echo "Create local catalog response code: $RESPONSE_CODE"
+
+
+
+# Step 3: Grant permissions
+echo "Setting up permissions..."
+
+# Grant TABLE_WRITE_DATA privilege to catalog_admin for local catalog
+RESPONSE_CODE=$(curl -s -X PUT -H "Authorization: Bearer ${SPARK_BEARER_TOKEN}" -H 'Accept: application/json' -H 'Content-Type: application/json' \
+ http://${POLARIS_HOST:-localhost}:8181/api/management/v1/catalogs/test-catalog-local/catalog-roles/catalog_admin/grants \
+ -d '{"type": "catalog", "privilege": "TABLE_WRITE_DATA"}' \
+ --write-out "%{http_code}")
+echo "Grant TABLE_WRITE_DATA to catalog_admin response code: $RESPONSE_CODE"
+
+# Assign catalog_admin to service_admin
+RESPONSE_CODE=$(curl -s -X PUT -H "Authorization: Bearer ${SPARK_BEARER_TOKEN}" -H 'Accept: application/json' -H 'Content-Type: application/json' \
+ http://${POLARIS_HOST:-localhost}:8181/api/management/v1/principal-roles/service_admin/catalog-roles/test-catalog-local \
+ -d '{"name": "catalog_admin"}' \
+ --write-out "%{http_code}")
+echo "Assign catalog_admin to service_admin response code: $RESPONSE_CODE"
+
+# Assign service_admin to new-user
+RESPONSE_CODE=$(curl -s -X PUT -H "Authorization: Bearer ${SPARK_BEARER_TOKEN}" -H 'Accept: application/json' -H 'Content-Type: application/json' \
+ http://${POLARIS_HOST:-localhost}:8181/api/management/v1/principals/new-user/principal-roles \
+ -d '{"name": "service_admin"}' \
+ --write-out "%{http_code}")
+echo "Assign service_admin to new-user response code: $RESPONSE_CODE"
+
+# Step 4: Create external catalog
+echo "Creating external catalog (passthrough facade)..."
+RESPONSE_CODE=$(curl -s -X POST -H "Authorization: Bearer ${SPARK_BEARER_TOKEN}" -H 'Content-Type: application/json' \
+ http://${POLARIS_HOST:-localhost}:8181/api/management/v1/catalogs \
+ -d "{
+ \"type\": \"EXTERNAL\",
+ \"name\": \"test-catalog-external\",
+ \"connectionConfigInfo\": {
+ \"connectionType\": \"ICEBERG_REST\",
+ \"uri\": \"http://${POLARIS_HOST:-localhost}:8181/api/catalog\",
+ \"remoteCatalogName\": \"test-catalog-local\",
+ \"authenticationParameters\": {
+ \"authenticationType\": \"OAUTH\",
+ \"tokenUri\": \"http://${POLARIS_HOST:-localhost}:8181/api/catalog/v1/oauth/tokens\",
+ \"clientId\": \"${NEW_CLIENT_ID}\",
+ \"clientSecret\": \"${NEW_CLIENT_SECRET}\",
+ \"scopes\": [\"PRINCIPAL_ROLE:ALL\"]
+ }
+ },
+ \"properties\": {
+ \"default-base-location\": \"file:///tmp/warehouse\"
+ },
+ \"storageConfigInfo\": {
+ \"storageType\": \"FILE\",
+ \"allowedLocations\": [\"file:///tmp/warehouse\"]
+ }
+ }" \
+ --write-out "%{http_code}")
+echo "Create external catalog response code: $RESPONSE_CODE"
+
+# Step 5: Grant permissions for external catalog
+echo "Setting up permissions for external catalog..."
+
+# Grant TABLE_WRITE_DATA privilege to catalog_admin role for test-catalog-external
+RESPONSE_CODE=$(curl -s -X PUT -H "Authorization: Bearer ${SPARK_BEARER_TOKEN}" -H 'Accept: application/json' -H 'Content-Type: application/json' \
+ http://${POLARIS_HOST:-localhost}:8181/api/management/v1/catalogs/test-catalog-external/catalog-roles/catalog_admin/grants \
+ -d '{"type": "catalog", "privilege": "TABLE_WRITE_DATA"}' \
+ --write-out "%{http_code}")
+echo "Grant TABLE_WRITE_DATA to external catalog_admin response code: $RESPONSE_CODE"
+
+# Assign catalog_admin role to service_admin principal-role for test-catalog-external
+RESPONSE_CODE=$(curl -s -X PUT -H "Authorization: Bearer ${SPARK_BEARER_TOKEN}" -H 'Accept: application/json' -H 'Content-Type: application/json' \
+ http://${POLARIS_HOST:-localhost}:8181/api/management/v1/principal-roles/service_admin/catalog-roles/test-catalog-external \
+ -d '{"name": "catalog_admin"}' \
+ --write-out "%{http_code}")
+echo "Assign catalog_admin to service_admin for external catalog response code: $RESPONSE_CODE"
+
+echo "Catalogs created successfully"
+
+echo ""
+echo "=== Starting federation test ==="
+
+# Test data operations via local catalog
+echo "=== Creating data via LOCAL catalog ==="
+cat << EOF | ${SPARK_HOME}/bin/spark-sql -S --conf spark.sql.catalog.polaris.token="${SPARK_BEARER_TOKEN}" --conf spark.sql.catalog.polaris.warehouse=test-catalog-local --conf spark.sql.defaultCatalog=polaris --conf spark.sql.extensions=org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions
+use polaris;
+create namespace if not exists ns1;
+create table if not exists ns1.test_table (id int, name string);
+insert into ns1.test_table values (1, 'Alice');
+insert into ns1.test_table values (2, 'Bob');
+create namespace if not exists ns2;
+create table if not exists ns2.test_table (id int, name string);
+insert into ns2.test_table values (1, 'Apache Spark');
+insert into ns2.test_table values (2, 'Apache Iceberg');
+EOF
+
+echo ""
+echo "=== Accessing data via EXTERNAL catalog ==="
+cat << EOF | ${SPARK_HOME}/bin/spark-sql -S --conf spark.sql.catalog.polaris.token="${SPARK_BEARER_TOKEN}" --conf spark.sql.catalog.polaris.warehouse=test-catalog-external --conf spark.sql.defaultCatalog=polaris --conf spark.sql.extensions=org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions
+use polaris;
+show namespaces;
+select * from ns1.test_table order by id;
+insert into ns1.test_table values (3, 'Charlie');
+select * from ns2.test_table order by id;
+insert into ns2.test_table values (3, 'Apache Polaris');
+EOF
+
+echo ""
+echo "=== Verifying federation via LOCAL catalog ==="
Review Comment:
I will update this test once #2223 is merged. For now, we can only do catalog-level RBACs for federated catalogs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add a regression test for Catalog Federation [polaris]
Posted by "poojanilangekar (via GitHub)" <gi...@apache.org>.
poojanilangekar commented on PR #2286:
URL: https://github.com/apache/polaris/pull/2286#issuecomment-3176131242
This is a regression test (which is still run by GitHub CI). Can I send out a separate PR for an integration test if that works for you? At that point we can remove this test if necessary. Currently we have no tests for catalog federation, so it might be a good idea to keep this around while I work on the IT test as you suggested.
For some context, I won't be able to dedicate as much time to the project going forward so I expect that to take some time, in the meantime it is a good idea to have some test that check that federation still works and flag PRs that potentially break federation.
Please let me know what you think.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add a regression test for Catalog Federation [polaris]
Posted by "poojanilangekar (via GitHub)" <gi...@apache.org>.
poojanilangekar commented on PR #2286:
URL: https://github.com/apache/polaris/pull/2286#issuecomment-3161965919
CC @dennishuo @eric-maynard
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add a regression test for Catalog Federation [polaris]
Posted by "poojanilangekar (via GitHub)" <gi...@apache.org>.
poojanilangekar commented on code in PR #2286:
URL: https://github.com/apache/polaris/pull/2286#discussion_r2263747008
##########
regtests/README.md:
##########
@@ -85,6 +85,15 @@ project, just run:
env POLARIS_HOST=localhost ./regtests/run.sh
```
+The catalog federation tests rely on the following configurations in `application.properties` to
+be set in order to succeed.
+
+```
+polaris.features."SUPPORTED_CATALOG_STORAGE_TYPES"=["S3","GCS","AZURE", "FILE"]
Review Comment:
The two flags are set as default JVM args
https://github.com/apache/polaris/blob/1b9316932458e80f7d16a685f4df9c13fbe9110e/runtime/server/build.gradle.kts#L77
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add a regression test for Catalog Federation [polaris]
Posted by "poojanilangekar (via GitHub)" <gi...@apache.org>.
poojanilangekar commented on code in PR #2286:
URL: https://github.com/apache/polaris/pull/2286#discussion_r2264155172
##########
regtests/README.md:
##########
@@ -85,6 +85,15 @@ project, just run:
env POLARIS_HOST=localhost ./regtests/run.sh
```
+The catalog federation tests rely on the following configurations in `application.properties` to
+be set in order to succeed.
+
+```
+polaris.features."SUPPORTED_CATALOG_STORAGE_TYPES"=["S3","GCS","AZURE", "FILE"]
Review Comment:
I just realized that we don't need the "FILE" parameter either because it's included in the JVM args. I've removed it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org