Verwenden Sie vom Katalog automatisch erzeugte Anmeldeinformationen für Apache Iceberg™-Tabellen¶
Mit der Unterstützung von automatisch erzeugten Anmeldeinformationen für Iceberg-Tabellen können Sie Snowflake Zugriff auf Ihre Tabellendaten und Metadaten im Cloud-Speicher geben, ohne ein externes Volume zu verwenden.
Stattdessen konfigurieren und delegieren Sie die Zugriffssteuerung mit dem Iceberg REST-Katalog eines Drittanbieters (z. B. Snowflake Open Catalog) und erstellen dann eine Katalogintegration in Snowflake, die für automatisch erzeugte Anmeldeinformationen konfiguriert ist. Für jede Iceberg-Tabelle, die mit der Katalogintegration verknüpft ist, verwendet Snowflake die von Ihrem Kataloganbieter bereitgestellten Anmeldeinformationen, um eine sichere Verbindung zu Ihrem externen Cloud-Speicher herzustellen.
Bemerkung
Using catalog-vended credentials is supported for externally managed Iceberg tables that use a REST catalog integration. To use this feature, your external catalog must also support credential vending.
Hinweise¶
Beachten Sie Folgendes, wenn Sie im Katalog automatisch erzeugte Anmeldeinformationen für Iceberg-Tabellen verwenden:
This feature is supported for tables that store their data and metadata in Amazon S3, Azure Storage, or Google Cloud Storage.
Tabellendateien müssen in einem einzigen Bucket gespeichert werden; sie können nicht auf mehrere Buckets verteilt werden.
Der mit Ihrem REST-Katalog konfigurierte Dienstprinzipal muss die Berechtigung haben, von allen Speicherorten zu lesen, die Ihre Tabellendateien in Ihrem Bucket enthalten. Wenn Sie AWS Lake-Formation mit AWS Glue verwenden, müssen Sie möglicherweise zusätzliche Schritte ausführen, um diesen Zugriff zu aktivieren. Weitere Informationen dazu finden Sie unter (Optional) Zugriffssteuerung für Lake Formation konfigurieren.
Snowflake erwartet, dass Ihr Katalog eines der folgenden Token bereitstellt, basierend auf Ihrem Cloudspeicher-Anbieter:
AWS: An expiration time for the AWS session token. Snowflake searches for a key-value pair where the key is
s3.session-token-expires-at-ms, and the value is a timestamp that specifies the expiration time in milliseconds.Azure: An expiration time for the SAS token. Snowflake searches for a key-value pair where the key is
adls.sas-token-expires-at-ms, and the value is a timestamp that specifies the expiration time in milliseconds.Google Cloud Storage: An expiration time for the OAuth 2.0 access token. Snowflake searches for a key-value pair where the key is
gcs.oauth2.token-expires-at, and the value is a timestamp that specifies the expiration time in milliseconds.
If your catalog doesn’t provide a token, Snowflake expects your catalog to provide an expiration time for vended credentials, and searches for a key-value pair where the key is
expiration-time, and the value is a timestamp that specifies the expiration time in milliseconds; for example,1730234407000.Wenn Ihr Katalog keine Ablaufzeit angibt, geht Snowflake davon aus, dass die Anmeldeinformationen 60 Minuten nach Erhalt ablaufen.
Table creation fails if your catalog provides credentials that aren’t valid.
Der Befehl CREATE ICEBERG TABLE … AS SELECT wird nicht unterstützt.
Die private Konnektivität wird nicht unterstützt; um sie zu nutzen, müssen Sie ein externes Volume konfigurieren.
Katalogintegration für automatisch erzeugte Anmeldeinformationen erstellen¶
Um eine Katalogintegration für automatisch erzeugte Anmeldeinformationen zu erstellen, verwenden Sie den Befehl CREATE CATALOG INTEGRATION (Apache Iceberg™ REST) mit der ACCESS_DELEGATION_MODE-Eigenschaft, die auf VENDED_CREDENTIALS eingestellt ist.
Wobei:
ACCESS_DELEGATION_MODE = { VENDED_CREDENTIALS | EXTERNAL_VOLUME_CREDENTIALS }den Zugriffsdelegierungsmodus angibt, der für den Zugriff auf Iceberg-Tabellendateien in Ihrem externen Cloud-Speicher verwendet werden soll.
VENDED_CREDENTIALSfestlegt, dass Snowflake automatisch erzeugte Anmeldeinformationen verwenden soll.EXTERNAL_VOLUME_CREDENTIALSfestlegt, dass Snowflake ein externes Volume verwenden soll.
Standard:
EXTERNAL_VOLUME_CREDENTIALS
You can specify the ACCESS_DELEGATION_MODE property in the list of REST_CONFIG properties in any
CREATE CATALOG INTEGRATION (Apache Iceberg™ REST) statement.
Wichtig
Wenn Sie AWS Lake Formation für die Zugriffssteuerung verwenden, müssen Sie sicherstellen, dass Snowflake auf Ihren AWS Glue-Katalog oder auf Ihre Amazon S3-Tabelle zugreifen kann. Weitere Informationen dazu finden Sie unter (Optional) Zugriffssteuerung für Lake Formation konfigurieren.
Beispiel: AWS Glue¶
Das folgende Beispiel erstellt eine Katalogintegration für AWS Glue, das automatisch erzeugte Anmeldeinformationen verwendet. Weitere Informationen dazu finden Sie unter Konfigurieren Sie eine Katalogintegration für AWS Glue Iceberg REST.
CREATE CATALOG INTEGRATION glue_rest_catalog_int
CATALOG_SOURCE = ICEBERG_REST
TABLE_FORMAT = ICEBERG
CATALOG_NAMESPACE = 'rest_catalog_integration'
REST_CONFIG = (
CATALOG_URI = 'https://glue.us-west-2.amazonaws.com/iceberg'
CATALOG_API_TYPE = AWS_GLUE
CATALOG_NAME = '123456789012'
ACCESS_DELEGATION_MODE = VENDED_CREDENTIALS
)
REST_AUTHENTICATION = (
TYPE = SIGV4
SIGV4_IAM_ROLE = 'arn:aws:iam::123456789012:role/my-role'
SIGV4_SIGNING_REGION = 'us-west-2'
)
ENABLED = TRUE;
Beispiel: Amazon S3-Tabellen¶
In diesem Beispiel wird eine Katalogintegration für Amazon S3-Tabellen mit in SigV4 aktivierter automatischer Erzeugung von Anmeldeinformationen unter Verwendung von Lake Formation erstellt.
CREATE OR REPLACE CATALOG INTEGRATION my_s3_tables_catalog_integration
CATALOG_SOURCE = ICEBERG_REST
TABLE_FORMAT = ICEBERG
CATALOG_NAMESPACE = 'my_namespace'
REST_CONFIG = (
CATALOG_URI = 'https://glue.us-west-2.amazonaws.com/iceberg'
CATALOG_API_TYPE = AWS_GLUE
CATALOG_NAME = '123456789012:S3tablescatalog/my_table_bucket'
ACCESS_DELEGATION_MODE = VENDED_CREDENTIALS
)
REST_AUTHENTICATION = (
TYPE = SIGV4
SIGV4_IAM_ROLE = 'arn:aws:iam::123456789012:role/my_api_permissions_role'
)
ENABLED = TRUE;
Wobei:
CATALOG_URI = 'https://glue.us-west-2.amazonaws.com/iceberg'Gibt den AWS Glue Iceberg REST-Endpunkt an.
CATALOG_NAME = 'aws_account_id:s3tablescatalog/s3_table_bucketGibt einen S3-Tabellen-Bucket in Ihrem AWS-Konto an.
Iceberg-Tabelle erstellen, die automatisch erzeugte Anmeldeinformationen verwendet¶
Nachdem Sie die Zugriffssteuerung mit dem Iceberg REST-Katalog eines Drittanbieters eingerichtet und eine Katalogintegration für automatisch erzeugte Anmeldeinformationen erstellt haben, können Sie eine Iceberg-Tabelle erstellen.
Wenn Sie eine Iceberg-Tabelle erstellen, die automatisch erzeugte Anmeldeinformationen verwendet, geben Sie eine Katalogintegration an, die mit ACCESS_DELEGATION_MODE = VENDED_CREDENTIALS konfiguriert ist, und schließen Sie den Parameter EXTERNAL_VOLUME von der CREATE ICEBERG TABLE (Iceberg REST Katalog)-Anweisung aus.
Beispiel:
CREATE ICEBERG TABLE my_iceberg_table
CATALOG = open_catalog_int_vended_credentials
CATALOG_TABLE_NAME = 'my_table'
AUTO_REFRESH = TRUE;
Bemerkung
Wenn Sie ein externes Standardvolumen auf Konto-, Datenbank- oder Schemaebene festgelegt haben, ignoriert Snowflake das externe Standardvolumen bei der Tabellenerstellung, solange Sie eine Katalogintegration angeben, die für die Verwendung von automatisch erzeugten Anmeldeinformationen konfiguriert ist.