リキッドクラスタリングを有効にする
適用対象 : SaaS コネクタ
データベースコネクタ
クエリーベースのコネクタ
リキッドクラスタリングは、テーブルのクラスタリング列に基づいてデータLayoutを最適化し、クエリーのパフォーマンスを向上させます。このページでは、管理されたインジェクションパイプラインによって作成される宛先の ストリーミングテーブル でリキッドクラスタリングを有効にする方法について説明します。
宛先テーブルはパイプラインによって管理されるストリーミングテーブルであるため、それらに対して直接 ALTER TABLE ... CLUSTER BY を実行することはできません。代わりに、table_configuration フィールドを使用して、パイプラインの ingestion_definition でクラスター構成を設定してください。
リキッドクラスタリングは、次の 2 つの方法で有効にできます。
属性 | レベル | 説明 |
|---|---|---|
| パイプライン |
|
| テーブル | 特定の宛先テーブルをクラスタリングするための列の明示的なリストを指定します。個々のテーブルの |
要件
- 自動リキッドクラスタリング (
enable_auto_clustering) には Databricks Runtime 15.4 LTS 以降が必要です。これは、インテリジェントなキー選択がそのバージョンで導入されたメタデータに依存しているためです。リキッドクラスタリングが有効なテーブルは、リキッドクラスタリングをサポートする任意の Databricks Runtime バージョン (Databricks Runtime 13.3 LTS 以降) から読み取りまたは書き込みが可能です。自動キー選択とバージョン動作の詳細については、自動リキッドクラスタリングを参照してください。
API を使用してリキッドクラスタリングを有効にする
Declarative Automation Bundles、ノートブック、または Databricks CLI を使用してマネージド インジェスト パイプラインを作成または編集する際に、リキッドクラスタリングを有効にできます。
次の例では、パイプライン レベル (enable_auto_clustering) で自動リキッドクラスタリングを有効にし、users_1 宛先テーブルに対して明示的な clustering_columns を指定しています。
- Declarative Automation Bundles
- Databricks notebook
- Databricks CLI
resources:
pipelines:
pipeline_cdc:
name: <pipeline-name>
catalog: <destination-catalog>
schema: <destination-schema>
ingestion_definition:
ingestion_gateway_id: <gateway-pipeline-id>
table_configuration:
enable_auto_clustering: true
objects:
- table:
source_schema: <source-schema>
source_table: users_1
destination_catalog: <destination-catalog>
destination_schema: <destination-schema>
table_configuration:
clustering_columns:
- user_id
- country
- table:
source_schema: <source-schema>
source_table: calendar_test
destination_catalog: <destination-catalog>
destination_schema: <destination-schema>
pipeline_spec = """
{
"ingestion_definition": {
"ingestion_gateway_id": "<gateway-pipeline-id>",
"table_configuration": {
"enable_auto_clustering": true
},
"objects": [
{
"table": {
"source_schema": "<source-schema>",
"source_table": "users_1",
"destination_catalog": "<destination-catalog>",
"destination_schema": "<destination-schema>",
"table_configuration": {
"clustering_columns": ["user_id", "country"]
}
}
},
{
"table": {
"source_schema": "<source-schema>",
"source_table": "calendar_test",
"destination_catalog": "<destination-catalog>",
"destination_schema": "<destination-schema>"
}
}
]
}
}
"""
{
"ingestion_definition": {
"ingestion_gateway_id": "<gateway-pipeline-id>",
"table_configuration": {
"enable_auto_clustering": true
},
"objects": [
{
"table": {
"source_schema": "<source-schema>",
"source_table": "users_1",
"destination_catalog": "<destination-catalog>",
"destination_schema": "<destination-schema>",
"table_configuration": {
"clustering_columns": ["user_id", "country"]
}
}
},
{
"table": {
"source_schema": "<source-schema>",
"source_table": "calendar_test",
"destination_catalog": "<destination-catalog>",
"destination_schema": "<destination-schema>"
}
}
]
}
}
制限事項
- 管理された取り込みパイプラインのリキッドクラスタリングは、チェンジデータキャプチャ (CDC) を使用するデータベースコネクタでのみサポートされています。SaaS コネクタおよびクエリーベースのコネクタはまだサポートされていません。
- 宛先テーブルで
ALTER TABLE ... CLUSTER BYを直接ランすることはできません。パイプラインのtable_configurationを介してクラスタリングを設定します。