メインコンテンツまでスキップ

Spark PK 重複排除ジョブの作成 (V2)

この操作は、primary key に基づく重複排除ジョブを作成します。

POST/v2/projects/{projectId}/jobs/dedup/pk
接続エンドポイント

https://api.cloud.zilliz.com

shell
export BASE_URL="https://api.cloud.zilliz.com"
パラメータ
Authorizationstringheader必要

認証トークンには、適切な権限を持つ API key を使用してください。

値の例: Bearer {{TOKEN}}
Idempotency-Keystringheader

作成リクエストを繰り返しても冪等となる一意のキーです。

値の例: spark-job-20260814-001
projectIdstringpath必要

プロジェクト ID。

値の例: proj-xxxxxxxxxxxxxxxxxxxx
リクエスト・ボディ
descriptionstring

ジョブの説明。

regionIdstring必要

クラウドリージョン ID。

inputobject

Spark ジョブのデータリソース (入力または出力) への参照。

typestring必要

データリソースの種類。

volumeNamestring必要

ボリューム名。

pathstring必要

ボリューム内のデータパス。

formatstring

データ形式。

writeModestring

書き込みモード。

dbNamestring

データベース名。

collectionNamestring

コレクション名。

outputobject

Spark ジョブのデータリソース (入力または出力) への参照。

typestring必要

データリソースの種類。

volumeNamestring必要

ボリューム名。

pathstring必要

ボリューム内のデータパス。

formatstring

データ形式。

writeModestring

書き込みモード。

dbNamestring

データベース名。

collectionNamestring

コレクション名。

resourceSizestring

ジョブのリソースサイズ。

timeoutSecondsinteger

秒単位のタイムアウト。

primaryKeyFieldstring必要

primary key フィールド。

keepBystring

どの重複レコードを保持するか。

Create Spark Jobbash
export TOKEN="YOUR_API_KEY"
export projectId="proj-xxxxxxxxxxxxxxxxxxxx"

curl --request POST \
--url "${BASE_URL}/v2/projects/${projectId}/jobs/dedup/pk" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Idempotency-Key: spark-job-20260814-001" \
--header "Request-Timeout: 5" \
--header "Content-Type: application/json" \
-d '{
"description": "Daily vector processing job.",
"regionId": "aws-us-west-2",
"input": {
"type": "VOLUME",
"volumeName": "volume-xxxxxxxxxxxxxxxxxxx",
"path": "/input/data.parquet",
"format": "parquet"
},
"output": {
"type": "VOLUME",
"volumeName": "volume-xxxxxxxxxxxxxxxxxxx",
"path": "/output/results",
"format": "parquet",
"writeMode": "OVERWRITE"
},
"resourceSize": "medium",
"timeoutSeconds": 3600,
"primaryKeyField": "id",
"keepBy": "updated_at:max"
}'
レスポンス

作成された Spark ジョブを返します。

成功レスポンス。

codeinteger

レスポンスコード。

値の例: 0
dataobject

Spark バッチジョブの概要情報です。

jobIdstring必要

コントロールプレーンのジョブ ID です。

projectIdstring必要

ジョブが属するプロジェクトの ID。

typestring必要

ジョブタイプです。Sparkジョブの場合、値は SPARK です。

descriptionstring

ジョブの説明。

statusstring必要

Spark バッチジョブのステータスです。

regionIdstring必要

Sparkジョブが実行されるクラウドリージョンです。

clusterIdstring

Sparkジョブに関連付けられた Zilliz Cloudクラスターです。

createdAtstring

Sparkジョブが作成された時刻です。

startedAtstring

Sparkジョブの実行が開始された時刻です。ジョブの開始前は、このフィールドが存在しない場合があります。

finishedAtstring

Sparkジョブが終了ステータスに達した時刻です。アクティブなジョブでは、このフィールドが存在しない場合があります。

durationSecondsinteger<int64>

経過実行時間(秒)です。アクティブなジョブの場合、この値は現在時刻までで計算されます。

失敗レスポンス。

codeinteger

レスポンスコード。

messagestring

エラーメッセージ。

Successjson
{
"code": 0,
"data": {
"jobId": "job-xxxxxxxxxxxxxxxxxx",
"sparkInstanceId": "sp-xxxxxxxxxxxxxxxxxx",
"type": "SPARK",
"jobName": "daily-vector-job",
"status": "PENDING",
"regionId": "aws-us-west-2",
"projectId": "proj-xxxxxxxxxxxxxxxxxxx"
}
}