メインコンテンツまでスキップ
バージョン: 26.x

Iceberg Rest カタログ API

このドキュメントでは、CREATE CATALOG文を通じてIceberg Rest Catalogインターフェースをサポートするメタデータサービスに接続およびアクセスする際にサポートされるパラメータについて説明します。

パラメータ概要

プロパティ名レガシー名説明デフォルト値必須
iceberg.rest.uriuriRestサービスのアドレスを指定します-はい
warehousewarehouseicebergウェアハウスを指定します-はい
iceberg.rest.security.typeRestサービスの認証方法を指定します。oauth2をサポートし、デフォルトはnone(認証なし)ですnoneいいえ
iceberg.rest.oauth2.tokenoauth2認証使用時のBearer token-いいえ
iceberg.rest.oauth2.scopeoauth2認証使用時に認可後にユーザーがアクセス可能なリソースのスコープと権限レベルを指定します-いいえ
iceberg.rest.oauth2.credentialtokenを取得するためにserver-uriにアクセスする際に使用されるoauth2資格情報-いいえ
iceberg.rest.oauth2.server-urioauth2 tokenを取得するためのURIアドレス。iceberg.rest.oauth2.credentialと併用します-いいえ
iceberg.rest.vended-credentials-enabledvended-credentials機能を有効にするかどうか。有効にすると、restサーバーからaccess-keysecret-keyなどのストレージシステムアクセス認証情報を取得し、手動指定の必要がなくなります。restサーバーがこの機能をサポートしている必要があります。falseいいえ
iceberg.rest.nested-namespace-enabled(バージョン3.1.2+でサポート) Nested Namespaceのサポートを有効にするかどうか。デフォルトはfalseです。trueの場合、Nested Namespaceはフラット化されてparent_ns.child_nsのようにDatabase名として表示されます。AWS GlueなどのいくつかのRest CatalogサービスはNested Namespaceをサポートしていないため、このパラメータはfalseに設定する必要がありますいいえ

注意:

  1. OAuth2認証とvended-credentials機能はバージョン3.1.0から サポートされています。

  2. 3.1.0より前のバージョンについては、レガシー名を使用してください。

  3. AWS Glue Rest Catalogについては、AWS Glueドキュメントを参照してください

Nested Namespace

3.1.2以降、Nested Namespaceに完全にアクセスするには、Catalogプロパティでiceberg.rest.nested-namespace-enabledtrueに設定することに加えて、以下のグローバルパラメータも有効にする必要があります:

SET GLOBAL enable_nested_namespace=true;

Catalogが"ice"、Namespaceが"ns1.ns2"、Tableが"tbl1"であると仮定すると、以下の方法でNested Namespaceにアクセスできます:

mysql> USE ice.ns1.ns2;
mysql> SELECT k1 FROM ice.`ns1.ns2`.tbl1;
mysql> SELECT tbl1.k1 FROM `ns1.ns2`.tbl1;
mysql> SELECT `ns1.ns2`.tbl1.k1 FROM ice.`ns1.ns2`.tbl1;
mysql> SELECT ice.`ns1.ns2`.tbl1.k1 FROM tbl1;
mysql> REFRESH CATALOG ice;
mysql> REFRESH DATABASE ice.`ns1.ns2`;
mysql> REFRESH TABLE ice.`ns1.ns2`.tbl1;

設定例

  • 認証なしのRest Catalogサービス

    CREATE CATALOG minio_iceberg PROPERTIES (
    'type' = 'iceberg',
    'iceberg.catalog.type' = 'rest',
    'uri' = 'http://172.21.0.1:8181',
    's3.access_key' = '<ak>',
    's3.secret_key' = '<sk>',
    's3.endpoint' = 'http://10.0.0.1:9000',
    's3.region' = 'us-east-1'
    );
  • AWS Glue Rest Catalogへの接続

    CREATE CATALOG glue_iceberg PROPERTIES (
    'type' = 'iceberg',
    'iceberg.catalog.type' = 'rest',
    'iceberg.rest.uri' = 'https://glue.<region>.amazonaws.com/iceberg',
    'warehouse' = '<acount_id>:s3tablescatalog/<s3_table_bucket_name>',
    'iceberg.rest.sigv4-enabled' = 'true',
    'iceberg.rest.signing-name' = 'glue',
    'iceberg.rest.access-key-id' = '<ak>',
    'iceberg.rest.secret-access-key' = '<sk>',
    'iceberg.rest.signing-region' = '<region>'
    );
  • Databricks Unity Iceberg Rest Catalogへの接続

    CREATE CATALOG unity_iceberg properties(
    "uri" = "https://dbc-59918a85-6c3a.cloud.databricks.com/api/2.1/unity-catalog/iceberg-rest/",
    "type" = "iceberg",
    "warehouse" = "<catalog_name>",
    "iceberg.catalog.type" = "rest",
    "iceberg.rest.security.type" = "oauth2",
    "iceberg.rest.oauth2.token" = "<token>",
    "iceberg.rest.vended-credentials-enabled" = "true",
    's3.endpoint' = 'https://s3.us-east-2.amazonaws.com',
    's3.region' = 'us-east-2'
    );
  • Apache Polaris Rest Catalogへの接続

    -- Enable vended-credentials
    CREATE CATALOG polaris_iceberg PROPERTIES (
    'type' = 'iceberg',
    'iceberg.catalog.type' = 'rest',
    'iceberg.rest.uri' = 'http://YOUR_POLARIS_HOST:8181/api/catalog',
    'warehouse' = '<catalog_name>',
    'iceberg.rest.security.type' = 'oauth2',
    'iceberg.rest.oauth2.credential' = 'client_id:client_secret',
    'iceberg.rest.oauth2.server-uri' = 'http://YOUR_POLARIS_HOST:8181/api/catalog/v1/oauth/tokens',
    'iceberg.rest.oauth2.scope' = 'PRINCIPAL_ROLE:doris_pr_role',
    'iceberg.rest.vended-credentials-enabled' = 'true',
    's3.endpoint' = 'https://s3.us-west-2.amazonaws.com',
    's3.region' = 'us-west-2'
    );

    -- Disable vended-credentials
    CREATE CATALOG polaris_iceberg PROPERTIES (
    'type' = 'iceberg',
    'iceberg.catalog.type' = 'rest',
    'iceberg.rest.uri' = 'http://YOUR_POLARIS_HOST:8181/api/catalog',
    'warehouse' = '<catalog_name>',
    'iceberg.rest.security.type' = 'oauth2',
    'iceberg.rest.oauth2.credential' = '6e155b128dc06c13:ce9fbb4cc91c43ff2955f2c6545239d7',
    'iceberg.rest.oauth2.server-uri' = 'http://YOUR_POLARIS_HOST:8181/api/catalog/v1/oauth/tokens',
    'iceberg.rest.oauth2.scope' = 'PRINCIPAL_ROLE:doris_pr_role',
    's3.access_key' = '<ak>',
    's3.secret_key' = '<sk>',
    's3.endpoint' = 'https://s3.us-west-2.amazonaws.com',
    's3.region' = 'us-west-2'
    );
  • Snowflake Open Catalogへの接続(3.1.2以降)

    -- Enable vended-credentials
    CREATE CATALOG snowflake_open_catalog PROPERTIES (
    'type' = 'iceberg',
    'warehouse' = '<catalog_name>',
    'iceberg.catalog.type' = 'rest',
    'iceberg.rest.uri' = 'https://<open_catalog_account>.snowflakecomputing.com/polaris/api/catalog',
    'iceberg.rest.security.type' = 'oauth2',
    'iceberg.rest.oauth2.credential' = '<client_id>:<client_secret>',
    'iceberg.rest.oauth2.scope' = 'PRINCIPAL_ROLE:<principal_role>',
    'iceberg.rest.vended-credentials-enabled' = 'true',
    's3.endpoint' = 'https://s3.us-west-2.amazonaws.com',
    's3.region' = 'us-west-2',
    'iceberg.rest.nested-namespace-enabled' = 'true'
    );
    -- Disable vended-credentials
    CREATE CATALOG snowflake_open_catalog PROPERTIES (
    'type' = 'iceberg',
    'warehouse' = '<catalog_name>',
    'iceberg.catalog.type' = 'rest',
    'iceberg.rest.uri' = 'https://<open_catalog_account>.snowflakecomputing.com/polaris/api/catalog',
    'iceberg.rest.security.type' = 'oauth2',
    'iceberg.rest.oauth2.credential' = '<client_id>:<client_secret>',
    'iceberg.rest.oauth2.scope' = 'PRINCIPAL_ROLE:<principal_role>',
    's3.access_key' = '<ak>',
    's3.secret_key' = '<sk>',
    's3.endpoint' = 'https://s3.us-west-2.amazonaws.com',
    's3.region' = 'us-west-2',
    'iceberg.rest.nested-namespace-enabled' = 'true'
    );
  • Apache Gravitino Rest Catalogへの接続

    -- Enable vended-credentials
    CREATE CATALOG gravitino_iceberg PROPERTIES (
    'type' = 'iceberg',
    'iceberg.catalog.type' = 'rest',
    'iceberg.rest.uri' = 'http://127.0.0.1:9001/iceberg/',
    'warehouse' = 's3://gravitino-iceberg-demo/warehouse',
    'iceberg.rest.vended-credentials-enabled' = 'true',
    's3.endpoint' = 'https://s3.us-west-2.amazonaws.com',
    's3.region' = 'us-west-2'
    );

    -- Disable vended-credentials
    CREATE CATALOG gravitino_iceberg PROPERTIES (
    'type' = 'iceberg',
    'iceberg.catalog.type' = 'rest',
    'iceberg.rest.uri' = 'http://127.0.0.1:9001/iceberg/',
    'warehouse' = 's3://gravitino-iceberg-demo/warehouse',
    'iceberg.rest.vended-credentials-enabled' = 'false',
    's3.access_key' = '<ak>',
    's3.secret_key' = '<sk>',
    's3.endpoint' = 'https://s3.us-west-2.amazonaws.com',
    's3.region' = 'us-west-2'
    );