This is an automated email from the ASF dual-hosted git repository.

yufei pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris.git


The following commit(s) were added to refs/heads/main by this push:
     new 37a7763a Fix Trino Getting-started Example (#868)
37a7763a is described below

commit 37a7763ae1563e8fb0564df7dea4f9d0e0a16acb
Author: Honah J. <[email protected]>
AuthorDate: Fri Jan 24 11:53:53 2025 -0800

    Fix Trino Getting-started Example (#868)
---
 getting-started/trino/README.md                          |  6 ++++++
 getting-started/trino/create-polaris-catalog.sh          |  5 +++++
 getting-started/trino/docker-compose.yml                 | 16 ++++++++++++----
 .../trino/trino-config/catalog/iceberg.properties        |  2 ++
 4 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/getting-started/trino/README.md b/getting-started/trino/README.md
index c4f99b08..26804a77 100644
--- a/getting-started/trino/README.md
+++ b/getting-started/trino/README.md
@@ -21,6 +21,12 @@
 
 This getting started guide provides a `docker-compose` file to set up 
[Trino](https://trino.io/) with Apache Polaris. Apache Polaris is configured as 
an Iceberg REST Catalog in Trino. 
 
+## Build Polaris Image
+Build Polaris Image while Docker is running
+```
+./gradlew :polaris-quarkus-server:assemble -Dquarkus.container-image.build=true
+```
+
 ## Run the `docker-compose` file
 To start the `docker-compose` file, run this command from the repo's root 
directory:
 ```
diff --git a/getting-started/trino/create-polaris-catalog.sh 
b/getting-started/trino/create-polaris-catalog.sh
index e5eb9633..20b007a8 100644
--- a/getting-started/trino/create-polaris-catalog.sh
+++ b/getting-started/trino/create-polaris-catalog.sh
@@ -38,3 +38,8 @@ curl -i -X POST -H "Authorization: Bearer $PRINCIPAL_TOKEN" 
-H 'Accept: applicat
           }
         }
       }'
+
+# Add TABLE_WRITE_DATA to the catalog's catalog_admin role since by default it 
can only manage access and metadata
+curl -i -X PUT -H "Authorization: Bearer $PRINCIPAL_TOKEN" -H 'Accept: 
application/json' -H 'Content-Type: application/json' \
+  
http://polaris:8181/api/management/v1/catalogs/polaris/catalog-roles/catalog_admin/grants
 \
+  -d '{"type": "catalog", "privilege": "TABLE_WRITE_DATA"}'
diff --git a/getting-started/trino/docker-compose.yml 
b/getting-started/trino/docker-compose.yml
index 3c9ab36f..5ea31fb4 100644
--- a/getting-started/trino/docker-compose.yml
+++ b/getting-started/trino/docker-compose.yml
@@ -19,19 +19,27 @@
 
 services:
   polaris:
-    build:
-      context: ../../
+    image: apache/polaris:latest
     ports:
       - "8181:8181"
       - "8182"
     environment:
       AWS_REGION: us-west-2
+      AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
+      AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
       GOOGLE_APPLICATION_CREDENTIALS: $GOOGLE_APPLICATION_CREDENTIALS
       AZURE_TENANT_ID: $AZURE_TENANT_ID
       AZURE_CLIENT_ID: $AZURE_CLIENT_ID
       AZURE_CLIENT_SECRET: $AZURE_CLIENT_SECRET
-      # add aws keys as dropwizard config
-      JAVA_OPTS: -Ddw.awsAccessKey=$AWS_ACCESS_KEY_ID 
-Ddw.awsSecretKey=$AWS_SECRET_ACCESS_KEY
+      polaris.persistence.type: in-memory
+      polaris.authentication.authenticator.type: test
+      polaris.authentication.token-service.type: test
+      polaris.authentication.token-broker.type: symmetric-key
+      polaris.authentication.token-broker.symmetric-key.secret: polaris
+      polaris.features.defaults."SUPPORTED_CATALOG_STORAGE_TYPES": 
'["FILE","S3","GCS","AZURE"]'
+      polaris.realm-context.realms: default-realm,realm1
+      quarkus.log.file.enable: false
+      quarkus.otel.sdk.disabled: "true"
 
     healthcheck:
       test: ["CMD", "curl", "http://localhost:8182/healthcheck";]
diff --git a/getting-started/trino/trino-config/catalog/iceberg.properties 
b/getting-started/trino/trino-config/catalog/iceberg.properties
index a5075530..94b8b489 100644
--- a/getting-started/trino/trino-config/catalog/iceberg.properties
+++ b/getting-started/trino/trino-config/catalog/iceberg.properties
@@ -23,3 +23,5 @@ iceberg.rest-catalog.uri=http://polaris:8181/api/catalog
 iceberg.rest-catalog.security=OAUTH2
 iceberg.rest-catalog.oauth2.token=principal:root;realm:default-realm
 iceberg.rest-catalog.warehouse=polaris
+# Required to support local filesystem: 
https://trino.io/docs/current/object-storage.html#configuration
+fs.hadoop.enabled=true

Reply via email to