Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions getting-started/eclipselink/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ This example requires `jq` to be installed on your machine.
You may not see Spark's prompt immediately, type ENTER to see it. A few commands that you can try:

```sql
CREATE NAMESPACE polaris.ns1;
USE polaris.ns1;
CREATE NAMESPACE quickstart_catalog.ns1;
USE quickstart_catalog.ns1;
CREATE TABLE table1 (id int, name string);
INSERT INTO table1 VALUES (1, 'a');
SELECT * FROM table1;
Expand All @@ -64,8 +64,7 @@ This example requires `jq` to be installed on your machine.
4. To access Polaris from the host machine, first request an access token:

```shell
export POLARIS_TOKEN=$(curl -s http://polaris:8181/api/catalog/v1/oauth/tokens \
--resolve polaris:8181:127.0.0.1 \
export POLARIS_TOKEN=$(curl -s http://localhost:8181/api/catalog/v1/oauth/tokens \
--user root:s3cr3t \
-d 'grant_type=client_credentials' \
-d 'scope=PRINCIPAL_ROLE:ALL' | jq -r .access_token)
Expand All @@ -74,15 +73,15 @@ This example requires `jq` to be installed on your machine.
5. Then, use the access token in the Authorization header when accessing Polaris:

```shell
curl -v http://127.0.0.1:8181/api/management/v1/principal-roles -H "Authorization: Bearer $POLARIS_TOKEN"
curl -v http://127.0.0.1:8181/api/management/v1/catalogs/quickstart_catalog -H "Authorization: Bearer $POLARIS_TOKEN"
curl -v http://localhost:8181/api/management/v1/principal-roles -H "Authorization: Bearer $POLARIS_TOKEN"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some other scripts we use POLARIS_HOST, like so:

env POLARIS_HOST=localhost ./regtests/run.sh

Should we consider doing something similar here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a getting-started example, I think users should always use localhost. How about we just keep it simple and avoid requiring them to copy-paste any extra code?

curl -v http://localhost:8181/api/management/v1/catalogs/quickstart_catalog -H "Authorization: Bearer $POLARIS_TOKEN"
```

6. Using Trino CLI: To access the Trino CLI, run this command:
```
docker exec -it eclipselink-trino-1 trino
docker exec -it polaris-trino-1 trino
```
Note, `trino-trino-1` is the name of the Docker container.
Note, `polaris-trino-1` is the name of the Docker container. The actual name on your system may vary.

Example Trino queries:
```
Expand Down
6 changes: 3 additions & 3 deletions getting-started/eclipselink/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ services:
--conf, "spark.sql.catalog.quickstart_catalog.type=rest",
--conf, "spark.sql.catalog.quickstart_catalog.warehouse=quickstart_catalog",
--conf, "spark.sql.catalog.quickstart_catalog.uri=http://polaris:8181/api/catalog",
--conf, "spark.sql.catalog.quickstart_catalog.credential=${USER_CLIENT_ID}:${USER_CLIENT_SECRET}",
--conf, "spark.sql.catalog.quickstart_catalog.credential=${CLIENT_ID}:${CLIENT_SECRET}",
--conf, "spark.sql.catalog.quickstart_catalog.scope=PRINCIPAL_ROLE:ALL",
--conf, "spark.sql.defaultCatalog=quickstart_catalog",
--conf, "spark.sql.catalogImplementation=in-memory",
Expand All @@ -98,8 +98,8 @@ services:
polaris-setup:
condition: service_completed_successfully
environment:
- CLIENT_ID=${USER_CLIENT_ID}
- CLIENT_SECRET=${USER_CLIENT_SECRET}
- CLIENT_ID=${CLIENT_ID}
- CLIENT_SECRET=${CLIENT_SECRET}
stdin_open: true
tty: true
ports:
Expand Down
Loading