-
Notifications
You must be signed in to change notification settings - Fork 0
add docs for polaris catalog #73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a15eb1b
add docs for polaris catalog
HarshCasper 72b3463
Update index.md
HarshCasper 689d781
Update content/en/user-guide/polaris-catalog/index.md
HarshCasper 6d9dd0c
Update content/en/user-guide/polaris-catalog/index.md
HarshCasper 69651ef
revamp polaris catalog docs
HarshCasper 14c0986
add some configuration options
HarshCasper 9b0cc92
add a step to create a S3 bucket
HarshCasper 0c8fbf0
last nits
HarshCasper File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
--- | ||
title: "Polaris Catalog" | ||
linkTitle: "Polaris Catalog" | ||
weight: 18 | ||
description: Get started with Polaris Catalog in LocalStack for Snowflake | ||
--- | ||
|
||
{{< preview-notice >}} | ||
|
||
## Introduction | ||
|
||
Polaris Catalog is a unified data catalog that provides a single view of all your data assets across Snowflake and external sources. It enables you to discover, understand, and govern your data assets, making it easier to find and use the right data for your analytics and machine learning projects. | ||
|
||
The Snowflake emulator supports creating Iceberg tables with Polaris catalog. Currently, [`CREATE CATALOG INTEGRATION`](https://docs.snowflake.com/en/sql-reference/sql/create-catalog-integration-open-catalog) is supported by LocalStack. | ||
|
||
## Getting started | ||
|
||
HarshCasper marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This guide is designed for users new to Iceberg tables with Polaris catalog and assumes basic knowledge of SQL and Snowflake. Start your Snowflake emulator and connect to it using an SQL client in order to execute the queries further below. | ||
|
||
In this guide, you will create an Iceberg table, display the data in the Iceberg table, and drop the Iceberg table. | ||
HarshCasper marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
HarshCasper marked this conversation as resolved.
Show resolved
Hide resolved
|
||
## Getting started | ||
|
||
This guide is designed for users new to Iceberg tables with Polaris catalog and assumes basic knowledge of SQL and Snowflake. Start your Snowflake emulator and connect to it using an SQL client in order to execute the queries further below. | ||
|
||
In this guide, you will create an Iceberg table, display the data in the Iceberg table, and drop the Iceberg table. | ||
|
||
### Create an Iceberg table | ||
|
||
You can create an Iceberg table using the `CREATE ICEBERG TABLE` statement. In this example, you can create an external volume called `v_demo`: | ||
HarshCasper marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
```sql | ||
CREATE OR REPLACE EXTERNAL VOLUME v_demo | ||
STORAGE_LOCATIONS = ( | ||
( | ||
NAME = 'aws-s3-test' | ||
STORAGE_PROVIDER = 'S3' | ||
STORAGE_BASE_URL = 's3://testbucket/' | ||
STORAGE_AWS_ROLE_ARN = '000000000000' | ||
ENCRYPTION=(TYPE='AWS_SSE_S3') | ||
) | ||
) | ||
ALLOW_WRITES = TRUE; | ||
``` | ||
|
||
### Create a Catalog integration | ||
|
||
You can then create a Catalog integration using the `CREATE CATALOG INTEGRATION` statement. In this example, you can create a catalog integration called `catalog_demo`: | ||
|
||
```sql | ||
CREATE CATALOG INTEGRATION catalog_demo | ||
CATALOG_SOURCE=ICEBERG_REST | ||
TABLE_FORMAT=ICEBERG | ||
CATALOG_NAMESPACE='test_namespace' | ||
REST_CONFIG=( | ||
CATALOG_URI='http://localhost:8181' | ||
CATALOG_NAME='polaris' | ||
) | ||
REST_AUTHENTICATION=( | ||
TYPE=OAUTH | ||
OAUTH_CLIENT_ID='root' | ||
OAUTH_CLIENT_SECRET='s3cr3t' | ||
OAUTH_ALLOWED_SCOPES=(PRINCIPAL_ROLE:ALL) | ||
) | ||
ENABLED=TRUE | ||
REFRESH_INTERVAL_SECONDS=60 | ||
COMMENT='Test catalog integration'; | ||
``` | ||
|
||
### Create an Iceberg table | ||
|
||
You can create an Iceberg table using the `CREATE ICEBERG TABLE` statement. In this example, you can create an Iceberg table called `t_demo`: | ||
|
||
```sql | ||
CREATE ICEBERG TABLE t_demo (c1 TEXT) | ||
CATALOG='catalog_demo', EXTERNAL_VOLUME='v_demo', BASE_LOCATION='test/test_namespace'; | ||
``` | ||
|
||
The output should be: | ||
|
||
```sql | ||
+-------------------------------------------+ | ||
| status | | ||
|-------------------------------------------| | ||
| Table "t_demo" successfully created. | | ||
+-------------------------------------------+ | ||
``` | ||
|
||
### Show Iceberg tables | ||
|
||
You can display the Iceberg tables using a `SELECT` query: | ||
|
||
```sql | ||
SELECT * FROM t_demo; | ||
HarshCasper marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
|
||
The output should be: | ||
|
||
```sql | ||
+----------+ | ||
| c1 | | ||
|----------| | ||
| iceberg | | ||
| foobar | | ||
| test | | ||
+----------+ | ||
``` | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: would be cool to maybe add a screenshot of Polaris catalog in action, displaying the Iceberge table created above. (but shoudn't be blocking, could be added in a future iteration 👍 ) |
||
### Drop Iceberg table | ||
|
||
You can drop the Iceberg table using the `DROP ICEBERG TABLE` statement: | ||
|
||
```sql | ||
DROP ICEBERG TABLE t_demo; | ||
``` | ||
|
||
The output should be: | ||
|
||
```sql | ||
+-------------------------------------------+ | ||
| status | | ||
| ------------------------------------------+ | ||
| T_DEMO successfully dropped. | | ||
+-------------------------------------------+ | ||
``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.