CREATE CATALOG INTEGRATION (Polaris Catalog)¶

Creates a new catalog integration for Apache Icebergâ„¢ tables that integrate with Polaris Catalog in the account or replaces an existing catalog integration.

See also:

DROP CATALOG INTEGRATION , SHOW CATALOG INTEGRATIONS, DESCRIBE CATALOG INTEGRATION

Syntax¶

CREATE [ OR REPLACE ] CATALOG INTEGRATION [ IF NOT EXISTS ]
  <name>
  CATALOG_SOURCE = POLARIS
  TABLE_FORMAT = ICEBERG
  CATALOG_NAMESPACE = '<polaris_namespace>'
  REST_CONFIG = (
    CATALOG_URI = '<polaris_account_url>'
    WAREHOUSE = '<polaris_catalog_name>'
  )
  REST_AUTHENTICATION = (
    TYPE = OAUTH
    OAUTH_CLIENT_ID = '<oauth_client_id>'
    OAUTH_CLIENT_SECRET = '<oauth_secret>'
    OAUTH_ALLOWED_SCOPES = ('<scope 1>', '<scope 2>')
  )
  ENABLED = { TRUE | FALSE }
  [ COMMENT = '<string_literal>' ]
Copy

Required parameters¶

name

String that specifies the identifier (name) for the catalog integration; must be unique in your account.

In addition, the identifier must start with an alphabetic character and cannot contain spaces or special characters unless the entire identifier string is enclosed in double quotes (for example, "My object"). Identifiers enclosed in double quotes are also case-sensitive.

For more information, see Identifier requirements.

CATALOG_SOURCE = POLARIS

Specifies Polaris Catalog as the catalog source.

TABLE_FORMAT = ICEBERG

Specifies Apache Icebergâ„¢ as the table format supplied by the catalog.

CATALOG_NAMESPACE = 'polaris_namespace'

Specifies the namespace in Polaris Catalog. Snowflake uses this namespace for all Iceberg tables that you associated with this catalog integration.

You can override this value by specifying a namespace at the table level when you create a table.

REST_CONFIG = ( ... )

Specifies information about your Polaris Catalog account and catalog name.

CATALOG_URI = 'https://polaris_account_url'

Your Polaris Catalog account locator URL.

WAREHOUSE = 'polaris_catalog_name'

The WAREHOUSE parameter specifies the name of the catalog to use in Polaris Catalog.

REST_AUTHENTICATION = ( ... )

Specifies authentication details that Snowflake uses to connect to Polaris Catalog.

TYPE = OAUTH

Specifies OAuth as the authentication type to use.

OAUTH_CLIENT_ID = 'oauth_client_id'

The client ID of the OAuth2 credential associated with your Polaris Catalog service connection.

OAUTH_CLIENT_SECRET = 'oauth_secret'

The secret of the OAuth2 credential associated with your Polaris Catalog service connection.

OAUTH_ALLOWED_SCOPES = ( 'scope_1', 'scope_2')

The scope of the OAuth token. Only one scope is included in the Iceberg REST API specification, but catalogs can support more than one scope in their implementation.

ENABLED = {TRUE | FALSE}

Specifies whether the catalog integration is available to use for Iceberg tables.

  • TRUE allows users to create new Iceberg tables that reference this integration. Existing Iceberg tables that reference this integration function normally.

  • FALSE prevents users from creating new Iceberg tables that reference this integration. Existing Iceberg tables that reference this integration cannot access the catalog in the table definition.

Optional parameters¶

COMMENT = 'string_literal'

String (literal) that specifies a comment for the integration.

Default: No value

Access control requirements¶

A role used to execute this SQL command must have the following privileges at a minimum:

Privilege

Object

Notes

CREATE INTEGRATION

Account

Only the ACCOUNTADMIN role has this privilege by default. The privilege can be granted to additional roles as needed.

For instructions on creating a custom role with a specified set of privileges, see Creating custom roles.

For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.

Usage notes¶

  • You can’t modify an existing catalog integration; use a CREATE OR REPLACE CATALOG INTEGRATION statement instead.

  • You can’t drop or replace a catalog integration if one or more Iceberg tables are associated with the catalog integration.

    To view the tables that depend on a catalog integration, you can use the SHOW ICEBERG TABLES command and a query using RESULT_SCAN that filters on the catalog_name column.

    Note

    The column identifier (catalog_name) is case-sensitive. Specify the column identifier exactly as it appears in the SHOW ICEBERG TABLES output.

    For example:

    SHOW ICEBERG TABLES;
    
    SELECT * FROM TABLE(
      RESULT_SCAN(
          LAST_QUERY_ID()
        )
      )
      WHERE "catalog_name" = 'my_catalog_integration_1';
    
    Copy
  • Regarding metadata:

    Attention

    Customers should ensure that no personal data (other than for a User object), sensitive data, export-controlled data, or other regulated data is entered as metadata when using the Snowflake service. For more information, see Metadata fields in Snowflake.

  • CREATE OR REPLACE <object> statements are atomic. That is, when an object is replaced, the old object is deleted and the new object is created in a single transaction.

Examples¶

The following example creates a catalog integration for Polaris Catalog for a particular namespace in a catalog.

CREATE OR REPLACE CATALOG INTEGRATION polaris_catalog_int
  CATALOG_SOURCE = POLARIS
  TABLE_FORMAT = ICEBERG
  CATALOG_NAMESPACE = 'my_catalog_namespace'
  REST_CONFIG = (
    CATALOG_URI = 'https://my_account.snowflakecomputing.com/polaris/api/catalog'
    WAREHOUSE = 'my_catalog_name'
  )
  REST_AUTHENTICATION = (
    TYPE = OAUTH
    OAUTH_CLIENT_ID = 'my_client_id'
    OAUTH_CLIENT_SECRET = 'my_client_secret'
    OAUTH_ALLOWED_SCOPES = ('PRINCIPAL_ROLE:ALL')
  )
  ENABLED = TRUE;
Copy