You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: site/content/in-dev/unreleased/getting-started/using-polaris.md
+13-15Lines changed: 13 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,12 @@ Title: Using Polaris
21
21
type: docs
22
22
weight: 400
23
23
---
24
-
24
+
## Setup
25
+
Define your `CLIENT_ID` & `CLIENT_SECRET` and export them for future use.
26
+
```shell
27
+
export CLIENT_ID=YOUR_CLIENT_ID
28
+
export CLIENT_SECRET=YOUR_CLIENT_SECRET
29
+
```
25
30
## Defining a Catalog
26
31
27
32
In Polaris, the [catalog]({{% relref "../entities#catalog" %}}) is the top-level entity that objects like [tables]({{% relref "../entities#table" %}}) and [views]({{% relref "../entities#view" %}}) are organized under. With a Polaris service running, you can create a catalog like so:
@@ -79,11 +84,13 @@ With a catalog created, we can create a [principal]({{% relref "../entities#prin
79
84
80
85
Be sure to provide the necessary credentials, hostname, and port as before.
81
86
82
-
When the `principals create` command completes successfully, it will return the credentials for this new principal. Be sure to note these down for later. For example:
87
+
When the `principals create` command completes successfully, it will return the credentials for this new principal. Export them for future use. For example:
83
88
84
-
```
89
+
```shell
85
90
./polaris ... principals create example
86
91
{"clientId": "XXXX", "clientSecret": "YYYY"}
92
+
export USER_CLIENT_ID=XXXX
93
+
export USER_CLIENT_SECRET=YYYY
87
94
```
88
95
89
96
Now, we grant the principal the [principal role]({{% relref "../entities#principal-role" %}}) we created, and grant the [catalog role]({{% relref "../entities#catalog-role" %}}) the principal role we created. For more information on these entities, please refer to the linked documentation.
Replace `XXXX` and `YYYY` with the client ID and client secret generated when you created the `quickstart_user` principal.
165
-
166
171
Similar to the CLI commands above, this configures Spark to use the Polaris running at `localhost:8181`. If your Polaris server is running elsewhere, but sure to update the configuration appropriately.
167
172
168
173
Finally, note that we include the `hadoop-aws` package here. If your table is using a different filesystem, be sure to include the appropriate dependency.
169
174
170
175
#### Using Spark SQL from a Docker container
171
176
172
-
Replace the credentials used in the Docker container using the following code:
173
-
177
+
Refresh the Docker container with the user's credentials:
174
178
```shell
175
-
USER_CLIENT_ID="XXXX"
176
-
USER_CLIENT_SECRET="YYYY"
177
-
sed -i "s/^\(.*spark\.sql\.catalog\.quickstart_catalog\.credential=\).*/\1${USER_CLIENT_ID}:${USER_CLIENT_SECRET}\",/" getting-started/eclipselink/docker-compose.yml
178
179
docker compose -f getting-started/eclipselink/docker-compose.yml up -d
179
180
```
180
181
@@ -233,12 +234,9 @@ org.apache.iceberg.exceptions.ForbiddenException: Forbidden: Principal 'quicksta
233
234
234
235
### Connecting with Trino
235
236
236
-
Replace the credentials used in the Docker container using the following code:
237
+
Refresh the Docker container with the user's credentials:
237
238
238
239
```shell
239
-
USER_CLIENT_ID="XXXX"
240
-
USER_CLIENT_SECRET="YYYY"
241
-
sed -i "s/^\(iceberg\.rest-catalog\.oauth2\.credential=\).*/\1${USER_CLIENT_ID}:${USER_CLIENT_SECRET}/" getting-started/eclipselink/trino-config/catalog/iceberg.properties
242
240
docker compose -f getting-started/eclipselink/docker-compose.yml down trino
243
241
docker compose -f getting-started/eclipselink/docker-compose.yml up -d
0 commit comments