ServiceNow インジェスト パイプラインを作成する
プレビュー
ServiceNow コネクタは、ゲート パブリック プレビュー段階です。プレビューに参加するには、Databricks アカウント チームにお問い合わせください。
この記事では、 Databricks LakeFlow Connectを使用して ServiceNow インジェストパイプラインを作成する方法について説明します。
始める前に
インジェスト パイプラインを作成するには、次の要件を満たす必要があります。
-
ワークスペースが Unity Catalog に対して有効になっています。
-
サーバレス コンピュートがワークスペースで有効になっています。 Enable サーバレス コンピュートを参照してください。
-
接続を作成する予定の場合: メタストアに対する
CREATE CONNECTION
権限があります。既存の接続を使用する予定の場合: 接続オブジェクトに対する
USE CONNECTION
権限またはALL PRIVILEGES
があります。 -
ターゲット・カタログに対する
USE CATALOG
権限があります。 -
既存のスキーマに対する
USE SCHEMA
権限とCREATE TABLE
権限、またはターゲット カタログに対するCREATE SCHEMA
権限を持っている。
ServiceNow から取り込むには、「 Databricks インジェスト用に ServiceNow を構成する」を参照してください。
インジェスト パイプラインを作成する
必要な権限: 接続 USE CONNECTION
または ALL PRIVILEGES
。
この手順では、インジェスト パイプラインを作成する方法について説明します。取り込まれた各テーブルは、同じ名前でストリーミングテーブルに書き込まれます。
- Databricks UI
- Databricks notebook
- Databricks CLI
-
In the sidebar of the Databricks workspace, click Data Ingestion.
-
On the Add data page, under Databricks connectors, click ServiceNow.
The ingestion wizard opens.
-
On the Ingestion pipeline page of the wizard, enter a unique name for the pipeline.
-
In the Destination catalog drop-down menu, select a catalog. Ingested data and event logs will be written to this catalog. You’ll select a destination schema later.
-
Select the Unity Catalog connection that stores the credentials required to access the source data.
If there are no existing connections to the source, click Create connection and enter the authentication details you obtained in Configure ServiceNow for Databricks ingestion. You must have
CREATE CONNECTION
privileges on the metastore. -
Click Create pipeline and continue.
-
On the Source page, select the tables to ingest into Databricks, and then click Next.
If you select All tables, the connector writes all existing and future tables in the source schema to the destination schema. There is a maximum of 250 tables per pipeline.
-
On the Destination page, select the Unity Catalog catalog and schema to write to.
If you don't want to use an existing schema, click Create schema. You must have
USE CATALOG
andCREATE SCHEMA
privileges on the parent catalog. -
Click Save pipeline and continue.
-
(Optional) On the Settings page, click Create schedule. Set the frequency to refresh the destination tables.
-
(Optional) Set email notifications for pipeline operation success or failure.
-
Click Save and run pipeline.
-
Generate a personal access token and copy the token so you can paste it into a notebook later. See Databricks personal access tokens for workspace users.
-
Import the following notebook to your workspace:
Create a ServiceNow ingestion pipeline
-
Modify the following values in the notebook:
Cell 1:
api_token
: The personal access token you generated
Cell 3:
-
name
: A name for the pipeline -
connection_name
: The name of the Unity Catalog connection you created in Catalog Explorer (Catalog > External data > Connections). If you don't have an existing connection to the source, you can create one. You must have theCREATE CONNECTION
privilege on the metastore. -
source_table
: The name of the source table -
destination_catalog
: A name for the destination catalog that will contain the ingested data -
destination_schema
: A name for the destination schema that will contain the ingested data -
scd_type
: The SCD method to use:SCD_TYPE_1
orSCD_TYPE_2
.For more information, see SCD type 1 vs. type 2.
-
Click Run all.
To create the pipeline:
databricks pipelines create --json "<pipeline definition or json file path>"
To edit the pipeline:
databricks pipelines update --json "<pipeline definition or json file path>"
To get the pipeline definition:
databricks pipelines get "<pipeline-id>"
To delete the pipeline:
databricks pipelines delete "<pipeline-id>"
For more information, run:
databricks pipelines --help
databricks pipelines <create|update|get|delete|...> --help
パイプラインのスケジュールと通知を更新する
-
パイプラインが作成されたら、 Databricks ワークスペースに再度アクセスし、[ パイプライン ] をクリックします。
新しいパイプラインがパイプライン リストに表示されます。
-
パイプラインの詳細を表示するには、パイプライン名をクリックします。
-
パイプラインの詳細ページで、[ スケジュール] をクリックしてパイプラインをスケジュールできます。
-
パイプラインに通知を設定するには、[ 設定 ] をクリックし、通知を追加します。