> ## Documentation Index
> Fetch the complete documentation index at: https://documents.trocco.io/llms.txt
> Use this file to discover all available pages before exploring further.
# データマート定義更新
> データマート定義を更新します。
データウェアハウス(DWH)タイプ自体の変更はできません。
また、現在更新可能なデータウェアハウスタイプはBigQuery、Snowflake、Databricks、Redshiftです。
## OpenAPI
````json PATCH /api/datamart_definitions/{datamart_definition_id}
{
"openapi": "3.0.3",
"info": {
"title": "trocco APIリファレンス",
"description": "trocco APIリファレンス",
"version": "0.0.1"
},
"servers": [
{
"url": "https://trocco.io"
}
],
"security": [
{
"ApiKeyAuth": []
}
],
"tags": [
{
"name": "users",
"description": "ユーザー",
"externalDocs": {
"url": "https://documents.trocco.io/docs/about-account-user"
}
},
{
"name": "teams",
"description": "チーム",
"externalDocs": {
"url": "https://documents.trocco.io/docs/team"
}
},
{
"name": "connections",
"description": "接続情報",
"externalDocs": {
"url": "https://documents.trocco.io/docs/connection-configurations"
}
},
{
"name": "custom_connectors",
"description": "カスタムコネクタ定義"
},
{
"name": "datamart_definitions",
"description": "データマート定義",
"externalDocs": {
"url": "https://documents.trocco.io/docs/data-mart"
}
},
{
"name": "environment_groups",
"description": "環境グループ"
},
{
"name": "environments",
"description": "環境"
},
{
"name": "jobs",
"description": "転送ジョブ",
"externalDocs": {
"url": "https://documents.trocco.io/docs/etl-configuration"
}
},
{
"name": "pipeline_jobs",
"description": "ワークフロージョブ",
"externalDocs": {
"url": "https://documents.trocco.io/docs/about-workflow"
}
},
{
"name": "resource_groups",
"description": "リソースグループ",
"externalDocs": {
"url": "https://documents.trocco.io/docs/resource-group"
}
},
{
"name": "dbt_git_repositories",
"description": "dbt Gitリポジトリ"
},
{
"name": "dbt_job_definitions",
"description": "dbtジョブ設定",
"externalDocs": {
"url": "https://documents.trocco.io/docs/dbt-job-configuration"
}
},
{
"name": "dbt_jobs",
"description": "dbtジョブ",
"externalDocs": {
"url": "https://documents.trocco.io/docs/dbt-job-configuration"
}
},
{
"name": "notification_destinations",
"description": "通知先",
"externalDocs": {
"url": "https://documents.trocco.io/docs/trocco-tutorial-additional-settings"
}
}
],
"externalDocs": {
"description": "trocco APIについて",
"url": "https://documents.trocco.io/docs/trocco-api"
},
"paths": {
"/api/datamart_definitions/{datamart_definition_id}": {
"patch": {
"summary": "データマート定義更新\n",
"description": "データマート定義を更新します。
\nデータウェアハウス(DWH)タイプ自体の変更はできません。
\nまた、現在更新可能なデータウェアハウスタイプはBigQuery、Snowflake、Databricks、Redshiftです。\n",
"operationId": "updateDatamartDefinition",
"tags": [
"datamart_definitions"
],
"parameters": [
{
"name": "datamart_definition_id",
"in": "path",
"description": "データマート定義IDを指定します。",
"required": true,
"schema": {
"type": "integer",
"format": "int64"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"name": {
"description": "データマート定義名を指定します。",
"type": "string",
"example": "test"
},
"description": {
"description": "メモを指定します。",
"type": "string",
"example": "desc",
"nullable": true
},
"is_runnable_concurrently": {
"description": "ジョブの並列実行可否を指定します。",
"type": "boolean",
"example": true
},
"resource_group_id": {
"description": "リソースグループのIDを指定します。",
"type": "integer",
"format": "int64",
"nullable": true
},
"custom_variable_settings": {
"description": "カスタム変数の設定を指定します。
\nnullまたは空の配列が指定された場合にはすべてのカスタム変数が削除されます。\n",
"type": "array",
"minItems": 0,
"maxItems": 40,
"items": {
"title": "CustomVariableSetting",
"type": "object",
"properties": {
"name": {
"description": "カスタム変数の変数名を指定します。
\n変数名を`$`で囲ってください。
\n",
"type": "string",
"example": "$start_time$"
},
"type": {
"description": "カスタム変数タイプです。
\nstring: 文字列
\ntimestamp: 時刻・日付(キューイング時)
\ntimestamp_runtime: 時刻・日付(実行時)\n",
"type": "string",
"enum": [
"string",
"timestamp",
"timestamp_runtime"
],
"example": "timestamp_runtime"
},
"value": {
"description": "カスタム変数名を展開する値を指定します。
\nカスタム変数タイプがstringのときのみ有効です。\n",
"type": "string",
"example": "jobs"
},
"quantity": {
"type": "integer",
"format": "int64",
"description": "unit 時間の数を指定します。
\nカスタム変数タイプがtimestampかtimestamp_runtime のときのみ有効です。\n",
"example": 1
},
"unit": {
"description": "時間の単位を指定します。
\nタイプがtimestampかtimestamp_runtime のときのみ有効です。
\nmonth_start: 当月月初、month_end: 当月月末、prev_month_end: 前月末 を指定した場合、quantity・direction は不要です。\n",
"type": "string",
"enum": [
"minute",
"hour",
"date",
"month",
"month_start",
"month_end",
"prev_month_end"
],
"example": "hour"
},
"direction": {
"description": "時間軸の方向です。
\nago: 前
\nlater: 後
\nタイプがtimestampかtimestamp_runtime のときのみ有効です。\n",
"type": "string",
"enum": [
"ago",
"later"
],
"example": "ago"
},
"format": {
"type": "string",
"description": "日付フォーマットです。
\nタイプがtimestampかtimestamp_runtime のときのみ有効です。\n",
"example": "%Y-%m-%d %H:%M:%S"
},
"time_zone": {
"description": "日付フォーマットの日時を解釈するタイムゾーンです。
\nタイプがtimestampかtimestamp_runtime のときのみ有効です。\n",
"type": "string",
"example": "Etc/UTC"
}
},
"required": [
"name",
"type"
]
}
},
"datamart_bigquery_option": {
"description": "BigQueryの設定を指定します。
\nデータウェアハウスタイプがBigQuery以外の時は指定できません。\n",
"nullable": true,
"allOf": [
{
"title": "DatamartBigqueryOptionRequest",
"type": "object",
"properties": {
"bigquery_connection_id": {
"description": "BigQueryの接続IDを指定します。
",
"type": "integer",
"format": "int64",
"example": 1
},
"query_mode": {
"description": "クエリ実行モードを指定します。
\ninsert: データ転送モード
\nquery: 自由記述モード\n",
"type": "string",
"enum": [
"insert",
"query"
]
},
"query": {
"description": "実行クエリを指定します。
",
"type": "string",
"example": "select * from tests"
},
"destination_dataset": {
"description": "出力先データセットを指定します。
\nquery_modeがinsertの場合のみ有効です。\n",
"type": "string",
"example": "test_dataset"
},
"destination_table": {
"description": "出力先テーブルを指定します。
\nquery_modeがinsertの場合のみ有効です。\n",
"type": "string",
"example": "test_table"
},
"write_disposition": {
"description": "書き込みモードを指定します。
\nquery_modeがinsertの場合のみ有効です。
\nappend: 追記
\ntruncate: 全件洗い替え
\nincremental: 増分更新
\nscd_type_2: SCD Type 2(履歴保持)\n",
"type": "string",
"enum": [
"append",
"truncate",
"incremental",
"scd_type_2"
],
"example": "truncate"
},
"schema_evolution_mode": {
"description": "スキーマ自動追従モードを指定します。
\nwrite_dispositionがincrementalまたはscd_type_2の場合に有効です。
\n未指定の場合はdetect_onlyが設定されます。
\ndetect_only: 検知のみ
\nauto_add_column: カラム自動追加\n",
"type": "string",
"enum": [
"detect_only",
"auto_add_column"
],
"nullable": true,
"example": "detect_only"
},
"merge_keys": {
"description": "キーカラムを指定します。レコードを一意に識別するキーを指定します。
\nwrite_dispositionがincrementalまたはscd_type_2の場合に必須です。\n",
"type": "array",
"items": {
"type": "string"
},
"example": [
"id"
]
},
"on_matched_action": {
"description": "キーが一致するレコードが存在した場合の挙動を指定します。
\nwrite_dispositionがincrementalの場合に必須です。
\nupsert: 上書き(既存のレコードを一旦DELETEしてから、新しいレコードをINSERTします。データの整合性を重視します。)
\nskip: スキップ(既存のレコードをそのまま残し、新しいレコードだけをINSERTします。)\n",
"type": "string",
"enum": [
"upsert",
"skip"
],
"nullable": true,
"example": "upsert"
},
"incremental_column": {
"description": "増分基準カラムを指定します。
\nwrite_dispositionがscd_type_2の場合に必須です。\n",
"type": "string",
"nullable": true,
"example": "updated_at"
},
"lookback_period_column": {
"description": "処理対象期間の基準カラム名を指定します。
\n全データを対象にする場合はlookback_period関連のパラメーターをすべて未指定にしてください。
\n指定する場合はlookback_period_column_typeも必須です。
\nwrite_dispositionがincrementalまたはscd_type_2の場合に有効です。\n",
"type": "string",
"nullable": true,
"example": "updated_at"
},
"lookback_period_column_type": {
"description": "処理対象期間カラムのデータ型を指定します。
\nwrite_dispositionがincrementalまたはscd_type_2の場合に有効です。\n",
"type": "string",
"enum": [
"TIMESTAMP",
"DATETIME",
"DATE"
],
"nullable": true,
"example": "TIMESTAMP"
},
"lookback_period_timezone": {
"description": "処理対象期間のタイムゾーンを指定します。
\nwrite_dispositionがincrementalまたはscd_type_2の場合に有効です。\n",
"type": "string",
"nullable": true,
"example": "Asia/Tokyo"
},
"lookback_period_from": {
"description": "処理対象期間の開始値を指定します。
\n指定する場合はlookback_period_unit、lookback_period_timezoneも必須になります。
\nwrite_dispositionがincrementalまたはscd_type_2の場合に有効です。\n",
"type": "integer",
"nullable": true,
"example": 3
},
"lookback_period_to": {
"description": "処理対象期間の終了値を指定します。
\n指定する場合はlookback_period_unit、lookback_period_timezoneも必須になります。
\nwrite_dispositionがincrementalまたはscd_type_2の場合に有効です。\n",
"type": "integer",
"nullable": true,
"example": 0
},
"lookback_period_unit": {
"description": "処理対象期間の単位を指定します。
\nwrite_dispositionがincrementalまたはscd_type_2の場合に有効です。
\ndays: 日
\nhours: 時間\n",
"type": "string",
"enum": [
"days",
"hours"
],
"nullable": true,
"example": "days"
},
"before_load": {
"description": "転送前に実行するクエリを指定します。
\nquery_modeがinsertの場合のみ有効です。\n",
"type": "string",
"nullable": true,
"example": "DELETE FROM tests"
},
"partitioning": {
"description": "パーティションタイプを指定します。
\nquery_modeがinsertの場合のみ有効です。
\n詳細は[パーティショニング・クラスタリングの設定](https://documents.trocco.io/docs/datamart-bigquery#%E3%83%91%E3%83%BC%E3%83%86%E3%82%A3%E3%82%B7%E3%83%A7%E3%83%8B%E3%83%B3%E3%82%B0%E3%83%BB%E3%82%AF%E3%83%A9%E3%82%B9%E3%82%BF%E3%83%AA%E3%83%B3%E3%82%B0%E3%81%AE%E8%A8%AD%E5%AE%9A)を参照ください。
\ningestion_time: 取り込み時間により分割
\ntime_unit_column: フィールドにより分割\n",
"type": "string",
"enum": [
"ingestion_time",
"time_unit_column"
],
"nullable": true,
"example": "time_unit_column"
},
"partitioning_time": {
"description": "分割する期間の単位を指定します。
\nquery_modeがinsertの場合のみ有効です。
\n詳細は[パーティショニング・クラスタリングの設定](https://documents.trocco.io/docs/datamart-bigquery#%E3%83%91%E3%83%BC%E3%83%86%E3%82%A3%E3%82%B7%E3%83%A7%E3%83%8B%E3%83%B3%E3%82%B0%E3%83%BB%E3%82%AF%E3%83%A9%E3%82%B9%E3%82%BF%E3%83%AA%E3%83%B3%E3%82%B0%E3%81%AE%E8%A8%AD%E5%AE%9A)を参照ください。
\n",
"type": "string",
"enum": [
"DAY",
"HOUR",
"MONTH",
"YEAR"
],
"nullable": true,
"example": "DAY"
},
"partitioning_field": {
"description": "分割するフィールド名を指定します。
\nquery_modeがinsertの場合のみ有効です。
\n詳細は[パーティショニング・クラスタリングの設定](https://documents.trocco.io/docs/datamart-bigquery#%E3%83%91%E3%83%BC%E3%83%86%E3%82%A3%E3%82%B7%E3%83%A7%E3%83%8B%E3%83%B3%E3%82%B0%E3%83%BB%E3%82%AF%E3%83%A9%E3%82%B9%E3%82%BF%E3%83%AA%E3%83%B3%E3%82%B0%E3%81%AE%E8%A8%AD%E5%AE%9A)を参照ください。
\n",
"type": "string",
"nullable": true,
"example": "test_field"
},
"clustering_fields": {
"description": "クラスタ化列を指定します。
\n詳細は [パーティショニング・クラスタリングの設定](https://documents.trocco.io/docs/datamart-bigquery#%E3%83%91%E3%83%BC%E3%83%86%E3%82%A3%E3%82%B7%E3%83%A7%E3%83%8B%E3%83%B3%E3%82%B0%E3%83%BB%E3%82%AF%E3%83%A9%E3%82%B9%E3%82%BF%E3%83%AA%E3%83%B3%E3%82%B0%E3%81%AE%E8%A8%AD%E5%AE%9A) を参照ください。\n",
"type": "array",
"minItems": 0,
"maxItems": 4,
"items": {
"type": "string"
},
"example": [
"customer_id",
"event_date"
]
},
"location": {
"description": "データ処理ローケーションを指定します。
\nquery_modeがqueryの場合のみ有効。\n",
"type": "string"
},
"table_description": {
"description": "出力先テーブルの説明を指定します。
\nquery_modeがinsertの場合のみ有効です。
\nジョブ実行後にBigQueryのテーブルのdescriptionへ反映されます。空文字を指定すると削除されます。\n",
"type": "string",
"maxLength": 1024,
"nullable": true,
"example": "テーブルの説明"
},
"column_descriptions": {
"description": "出力先テーブルのカラム説明を指定します。
\nquery_modeがinsertの場合のみ有効です。
\n指定したカラムのみジョブ実行後にBigQueryのカラムのdescriptionへ反映されます。
\ndescriptionに空文字を指定すると、そのカラムのdescriptionは削除されます。指定しなかったカラムは変更されません。
\nこのパラメータを指定しない場合は既存の設定を保持します。空配列を指定すると全カラムの設定を削除します。
\n配列の順序は保持して保存されます。\n",
"type": "array",
"nullable": true,
"items": {
"type": "object",
"properties": {
"name": {
"description": "カラム名を指定します。
\n英字またはアンダースコア始まりで、英数字とアンダースコアのみ使用できます。\n",
"type": "string",
"example": "id"
},
"description": {
"description": "カラムの説明を指定します(最大1024文字)。",
"type": "string",
"maxLength": 1024,
"example": "主キー"
}
},
"required": [
"name",
"description"
]
}
},
"quality_check_enabled": {
"description": "品質チェックを有効化するかどうかを指定します。
\nquery_modeがinsertの場合のみ有効です。
\nquality_check_*は指定した項目のみ更新され、指定しない項目は既存の設定を保持します。
\nquality_check_enabled: false で無効化します(他の品質チェック設定は保持されます)。\n",
"type": "boolean",
"nullable": true,
"example": true
},
"quality_check_on_violation": {
"description": "品質チェック違反時の挙動を指定します。
\nquality_check_enabledがtrueの場合に必須です。
\nfail: ジョブを失敗させる
\nwarn: 警告のみ(ジョブは成功扱い)\n",
"type": "string",
"enum": [
"fail",
"warn"
],
"nullable": true,
"example": "fail"
},
"quality_check_lookback_period_column": {
"description": "品質チェック対象期間の基準カラム名を指定します。
\n全データを対象にする場合はquality_check_lookback_period関連のパラメーターをすべて未指定にしてください。
\n指定する場合はquality_check_lookback_period_column_typeも必須です。\n",
"type": "string",
"nullable": true,
"example": "updated_at"
},
"quality_check_lookback_period_column_type": {
"description": "品質チェック対象期間の基準カラムのデータ型を指定します。",
"type": "string",
"enum": [
"TIMESTAMP",
"DATETIME",
"DATE"
],
"nullable": true,
"example": "TIMESTAMP"
},
"quality_check_lookback_period_timezone": {
"description": "品質チェック対象期間のタイムゾーンを指定します。",
"type": "string",
"nullable": true,
"example": "Asia/Tokyo"
},
"quality_check_lookback_period_from": {
"description": "品質チェック対象期間の開始値を指定します。
\n指定する場合はquality_check_lookback_period_unit、quality_check_lookback_period_timezoneも必須になります。\n",
"type": "integer",
"nullable": true,
"example": 7
},
"quality_check_lookback_period_to": {
"description": "品質チェック対象期間の終了値を指定します。
\n指定する場合はquality_check_lookback_period_unit、quality_check_lookback_period_timezoneも必須になります。\n",
"type": "integer",
"nullable": true,
"example": 0
},
"quality_check_lookback_period_unit": {
"description": "品質チェック対象期間の単位を指定します。
\nquality_check_lookback_period_column_typeがDATEの場合はdaysのみ指定できます。
\ndays: 日
\nhours: 時間\n",
"type": "string",
"enum": [
"days",
"hours"
],
"nullable": true,
"example": "days"
},
"quality_checks": {
"description": "品質チェック項目を指定します。
\nquality_check_enabledがtrueの場合は1件以上の指定が必須です。
\n配列の順序は保持して保存されます。\n",
"type": "array",
"nullable": true,
"items": {
"type": "object",
"properties": {
"check_type": {
"description": "チェック種別を指定します。
\nnot_null: NOT NULL チェック
\nunique: UNIQUE チェック
\ncomposite_unique: 複合カラム一意性チェック\n",
"type": "string",
"enum": [
"not_null",
"unique",
"composite_unique"
],
"example": "not_null"
},
"column_names": {
"description": "チェック対象カラム名を指定します。",
"type": "array",
"items": {
"type": "string"
},
"example": [
"email"
]
}
},
"required": [
"check_type",
"column_names"
]
}
}
}
}
]
},
"datamart_snowflake_setting": {
"description": "Snowflakeの設定を指定します。
\nデータウェアハウスがSnowflake以外の時は指定できません。\n",
"nullable": true,
"allOf": [
{
"title": "DatamartSnowflakeSettingRequest",
"type": "object",
"properties": {
"snowflake_connection_id": {
"description": "Snowflakeの接続IDを指定します。
",
"type": "integer",
"format": "int64",
"example": 1
},
"query_mode": {
"description": "クエリ実行モードを指定します。
\ninsert: データ転送モード
\nquery: 自由記述モード\n",
"type": "string",
"enum": [
"insert",
"query"
]
},
"query": {
"description": "実行クエリを指定します。
",
"type": "string",
"example": "SELECT * FROM EXAMPLE_DATABASE.EXAMPLE_SCHEMA.EXAMPLE_TABLE"
},
"warehouse": {
"description": "仮想ウェアハウスを指定します。
",
"type": "string",
"example": "EXAMPLE_WH"
},
"statement_timeout": {
"description": "クエリのタイムアウト時間(秒)を指定します。
\n0を指定した場合はSnowflakeのSTATEMENT_TIMEOUT_IN_SECONDSが利用されます。\n",
"type": "integer",
"format": "int32",
"example": 43200
},
"destination_database": {
"description": "出力先データベースを指定します。
\nquery_modeがinsertの場合のみ有効です。\n",
"type": "string",
"example": "EXAMPLE_TABLE"
},
"destination_schema": {
"description": "出力先スキーマを指定します。
\nquery_modeがinsertの場合のみ有効です。\n",
"type": "string",
"example": "EXAMPLE_SCHEMA"
},
"destination_table": {
"description": "出力先テーブル(スキーマオブジェクト)を指定します。
\nquery_modeがinsertの場合のみ有効です。\n",
"type": "string",
"example": "EXAMPLE_TABLE"
},
"write_disposition": {
"description": "書き込みモードを指定します。
\nquery_modeがinsertの場合のみ有効です。
\nappend: 追記
\nreplace: 洗い替え
\ntruncate: 全件洗い替え
\nincremental: 増分更新
\nscd_type_2: SCD Type 2(履歴保持)\n",
"type": "string",
"enum": [
"append",
"replace",
"truncate",
"incremental",
"scd_type_2"
],
"example": "truncate"
},
"merge_keys": {
"description": "結合キーを指定します。incremental / scd_type_2 で必須です。\n",
"type": "array",
"items": {
"type": "string"
},
"example": [
"customer_id"
]
},
"on_matched_action": {
"description": "既存レコードの扱いを指定します。incremental で必須です。
\nupsert: 上書き
\nskip: スキップ\n",
"type": "string",
"enum": [
"upsert",
"skip"
],
"example": "upsert"
},
"incremental_column": {
"description": "変更検知に使うカラム名を指定します。scd_type_2 で必須です。\n",
"type": "string",
"example": "updated_at"
},
"lookback_period_column": {
"description": "処理対象期間の判定に使うカラム名を指定します。",
"type": "string",
"example": "updated_at"
},
"lookback_period_column_type": {
"description": "処理対象期間カラムの型を指定します。",
"type": "string",
"enum": [
"TIMESTAMP_NTZ",
"TIMESTAMP_TZ",
"TIMESTAMP_LTZ",
"DATE"
],
"example": "TIMESTAMP_NTZ"
},
"lookback_period_from": {
"description": "処理対象期間(開始)の値を指定します。",
"type": "integer",
"format": "int32",
"example": 7
},
"lookback_period_to": {
"description": "処理対象期間(終了)の値を指定します。",
"type": "integer",
"format": "int32"
},
"lookback_period_unit": {
"description": "処理対象期間の単位を指定します。",
"type": "string",
"enum": [
"days",
"hours"
],
"example": "days"
},
"lookback_period_timezone": {
"description": "処理対象期間のタイムゾーンを指定します。",
"type": "string",
"example": "Asia/Tokyo"
},
"schema_evolution_mode": {
"description": "スキーマ追従モードを指定します。
\ndetect_only: 検出のみ
\nauto_add_column: カラム自動追加\n",
"type": "string",
"enum": [
"detect_only",
"auto_add_column"
]
},
"quality_check_enabled": {
"description": "品質チェックを有効化するかどうかを指定します。",
"type": "boolean"
},
"quality_check_on_violation": {
"description": "品質チェック違反時の挙動を指定します。
\nfail: ジョブを失敗させる
\nwarn: 警告のみ\n",
"type": "string",
"enum": [
"fail",
"warn"
]
},
"quality_check_lookback_period_column": {
"description": "品質チェック基準カラム名を指定します。",
"type": "string",
"example": "updated_at"
},
"quality_check_lookback_period_column_type": {
"description": "品質チェック基準カラムの型を指定します。",
"type": "string",
"enum": [
"TIMESTAMP_NTZ",
"TIMESTAMP_TZ",
"TIMESTAMP_LTZ",
"DATE"
],
"example": "TIMESTAMP_NTZ"
},
"quality_check_lookback_period_timezone": {
"description": "品質チェック対象期間のタイムゾーンを指定します。",
"type": "string",
"example": "Asia/Tokyo"
},
"quality_check_lookback_period_from": {
"description": "品質チェック対象期間(開始)の値を指定します。",
"type": "integer",
"format": "int32"
},
"quality_check_lookback_period_to": {
"description": "品質チェック対象期間(終了)の値を指定します。",
"type": "integer",
"format": "int32"
},
"quality_check_lookback_period_unit": {
"description": "品質チェック対象期間の単位を指定します。",
"type": "string",
"enum": [
"days",
"hours"
]
},
"quality_checks": {
"description": "品質チェック項目を指定します。",
"type": "array",
"items": {
"type": "object",
"properties": {
"check_type": {
"description": "チェック種別を指定します。
\nnot_null: NOT NULL チェック
\nunique: UNIQUE チェック
\ncomposite_unique: 複合カラム一意性チェック\n",
"type": "string",
"enum": [
"not_null",
"unique",
"composite_unique"
]
},
"column_names": {
"description": "チェック対象カラム名を指定します。",
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
}
]
},
"datamart_databricks_setting": {
"description": "Databricksの設定を指定します。
\nデータウェアハウスがDatabricks以外の時は指定できません。\n",
"nullable": true,
"allOf": [
{
"title": "DatamartDatabricksSettingRequest",
"type": "object",
"properties": {
"databricks_connection_id": {
"description": "Databricksの接続IDを指定します。
",
"type": "integer",
"format": "int64",
"example": 1
},
"query_mode": {
"description": "クエリ実行モードを指定します。
\ninsert: データ転送モード
\nquery: 自由記述モード\n",
"type": "string",
"enum": [
"insert",
"query"
]
},
"query": {
"description": "実行クエリを指定します。
",
"type": "string",
"example": "SELECT * FROM example_catalog.example_schema.example_table"
},
"destination_catalog": {
"description": "出力先カタログを指定します。
\nquery_modeがinsertの場合のみ有効です。\n",
"type": "string",
"example": "example_catalog"
},
"destination_schema": {
"description": "出力先スキーマを指定します。
\nquery_modeがinsertの場合のみ有効です。\n",
"type": "string",
"example": "example_schema"
},
"destination_table": {
"description": "出力先テーブルを指定します。
\nquery_modeがinsertの場合のみ有効です。\n",
"type": "string",
"example": "example_table"
},
"write_disposition": {
"description": "書き込みモードを指定します。
\nquery_modeがinsertの場合のみ有効です。
\nappend: 追記
\nreplace: 全件洗い替え(既存のテーブルがDROPされてクエリ実行結果に置き換えられます)
\ntruncate_insert: 全件洗い替え(既存のテーブルのレコードがTRUNCATEされて、クエリ実行結果に置き換えられます)\n",
"type": "string",
"enum": [
"append",
"replace",
"truncate_insert"
],
"example": "truncate_insert"
}
}
}
]
},
"datamart_redshift_setting": {
"description": "Redshiftの設定を指定します。
\nデータウェアハウスがRedshift以外の時は指定できません。\n",
"nullable": true,
"allOf": [
{
"title": "DatamartRedshiftSettingRequest",
"type": "object",
"properties": {
"redshift_connection_id": {
"description": "Redshiftの接続IDを指定します。
",
"type": "integer",
"format": "int64",
"example": 1
},
"query_mode": {
"description": "クエリ実行モードを指定します。
\ninsert: データ転送モード
\nquery: 自由記述モード\n",
"type": "string",
"enum": [
"insert",
"query"
]
},
"query": {
"description": "実行クエリを指定します。
",
"type": "string",
"example": "SELECT * FROM example_schema.example_table"
},
"database": {
"description": "接続先データベースを指定します。\n",
"type": "string",
"example": "example_database"
},
"destination_schema": {
"description": "出力先スキーマを指定します。
\nquery_modeがinsertの場合のみ有効です。\n",
"type": "string",
"example": "example_schema"
},
"destination_table": {
"description": "出力先テーブルを指定します。
\nquery_modeがinsertの場合のみ有効です。\n",
"type": "string",
"example": "example_table"
},
"write_disposition": {
"description": "書き込みモードを指定します。
\nquery_modeがinsertの場合のみ有効です。
\nappend: 追記
\ntruncate: 全件洗い替え(既存のテーブルのレコードがTRUNCATEされて、クエリ実行結果に置き換えられます)\n",
"type": "string",
"enum": [
"append",
"truncate"
],
"example": "truncate"
}
}
}
]
},
"schedules": {
"description": "スケジュール設定を指定します。
\n既存のスケジュール設定はすべて指定された値で洗い替えされます。
\n空の配列を指定するとすべて削除されます。\n",
"type": "array",
"minItems": 0,
"maxItems": 24,
"items": {
"title": "Schedule",
"type": "object",
"properties": {
"frequency": {
"description": "スケジュールの頻度です。
\nhourly: 毎時
\ndaily: 毎日
\nweekly: 毎週
\nmonthly: 毎月\n",
"type": "string",
"enum": [
"hourly",
"daily",
"weekly",
"monthly"
]
},
"minute": {
"description": "分の値を示します。",
"type": "integer",
"format": "int64"
},
"hour": {
"description": "時間の値を示します。",
"type": "integer",
"format": "int64"
},
"day": {
"description": "日にちの値を示します。",
"type": "integer",
"format": "int64"
},
"day_of_week": {
"description": "曜日の値を示します。",
"type": "integer",
"format": "int64"
},
"time_zone": {
"description": "日時のタイムゾーンです。",
"type": "string",
"example": "Etc/UTC"
}
},
"required": [
"frequency",
"time_zone"
]
}
},
"labels": {
"description": "ラベル設定を指定します。
\n既存のラベルはすべて指定された値で洗い替えされます。
\n空の配列を指定するとすべて削除されます。\n",
"type": "array",
"minItems": 0,
"maxItems": 40,
"items": {
"type": "string",
"description": "ラベル名を指定します。"
}
},
"notifications": {
"description": "通知設定を指定します。
\n既存の通知設定はすべて指定された値で洗い替えされます。
\n空の配列を指定するとすべて削除されます。\n",
"type": "array",
"minItems": 0,
"maxItems": 20,
"items": {
"title": "DatamartNotification",
"type": "object",
"properties": {
"id": {
"description": "通知設定のIDです。
\nnotification_type の中で一意です。slack と email が同じ親レコードから派生する場合は同じ id を持つため、destination_type を併用して識別してください。\n",
"type": "integer",
"format": "int64",
"readOnly": true
},
"destination_type": {
"description": "通知先です。",
"type": "string",
"enum": [
"slack",
"email",
"http"
]
},
"slack_channel_id": {
"description": "slack channel IDです。
\ndestination_typeがslackのとき必須です。\n",
"type": "integer",
"format": "int64"
},
"email_id": {
"description": "Email IDです。
\ndestination_typeがemailのとき必須です。\n",
"type": "integer",
"format": "int64"
},
"http_notification_destination_id": {
"description": "通知先HTTPのIDです。
\ndestination_typeがhttpのとき必須です。\n",
"type": "integer",
"format": "int64"
},
"notification_type": {
"description": "通知タイプです。
\njob: ジョブ実行時の通知(通知条件はnotify_whenで指定)
\nrecord: レコード条件(超過/過不足)通知\n",
"type": "string",
"enum": [
"job",
"record"
]
},
"notify_when": {
"description": "通知条件です。
\njobタイプのとき必須です。
\n
\n- finished: ジョブ終了時(成功・失敗・キャンセル・スキップ)
\n- failed: ジョブ失敗時(失敗・キャンセル・スキップ)
\n- quality_check_failed: ジョブ成功時に品質チェックの違反を検知したとき(quality_check_on_violationがwarnの場合)
\n- schema_evolution_detected: スキーマ変化を検知したとき\n",
"type": "string",
"enum": [
"finished",
"failed",
"quality_check_failed",
"schema_evolution_detected"
]
},
"message": {
"description": "通知内容です。
\ndestination_typeがhttpのときは、HTTPリクエストボディとして送信されるJSON文字列を指定します(メタ変数・カスタム変数の展開に対応)。\n",
"type": "string"
},
"record_count": {
"description": "閾値のレコード数
\nrecordタイプのとき必須です。\n",
"type": "integer",
"format": "int64"
},
"record_operator": {
"description": "レコード数の比較演算子です
\nrecordタイプのとき必須
\nabove: 以上
\nbelow: 以下\n",
"type": "string",
"enum": [
"above",
"below"
]
}
},
"required": [
"destination_type",
"notification_type"
]
}
}
}
}
}
}
},
"responses": {
"200": {
"description": "Successfully updated.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"description": "データマート定義IDです。",
"type": "integer",
"format": "int64",
"example": 1
},
"name": {
"type": "string",
"description": "データマート定義名です。",
"example": "test"
},
"description": {
"type": "string",
"description": "メモです。",
"example": "desc"
},
"data_warehouse_type": {
"type": "string",
"description": "データウェアハウスタイプです。",
"example": "bigquery"
},
"is_runnable_concurrently": {
"type": "boolean",
"description": "ジョブの並列実行可否です。",
"example": true
},
"resource_group": {
"allOf": [
{
"title": "ResourceGroup",
"type": "object",
"properties": {
"id": {
"description": "リソースグループIDです。",
"type": "integer",
"format": "int64",
"example": 1
},
"name": {
"description": "リソースグループ名です。",
"type": "string",
"example": "resource group"
},
"description": {
"description": "メモです。",
"type": "string",
"nullable": true,
"example": "description"
},
"teams": {
"description": "チームです。",
"type": "array",
"minItems": 0,
"items": {
"type": "object",
"properties": {
"team_id": {
"description": "チームIDです。",
"type": "integer",
"format": "int64",
"example": 1
},
"role": {
"description": "ロールです。",
"type": "string",
"enum": [
"administrator",
"editor",
"operator",
"viewer"
],
"example": "administrator"
}
}
}
},
"created_at": {
"description": "リソースグループの作成日時です。",
"type": "string",
"example": "2023-08-22T18:00:00+00:00"
},
"updated_at": {
"description": "リソースグループの更新日時です。",
"type": "string",
"example": "2023-08-22T18:00:00+00:00"
}
},
"required": [
"id",
"name",
"created_at",
"updated_at"
]
},
{
"nullable": true
}
]
},
"custom_variable_settings": {
"type": "array",
"description": "カスタム変数一覧です。",
"items": {
"title": "CustomVariableSetting",
"type": "object",
"properties": {
"name": {
"description": "カスタム変数の変数名を指定します。
\n変数名を`$`で囲ってください。
\n",
"type": "string",
"example": "$start_time$"
},
"type": {
"description": "カスタム変数タイプです。
\nstring: 文字列
\ntimestamp: 時刻・日付(キューイング時)
\ntimestamp_runtime: 時刻・日付(実行時)\n",
"type": "string",
"enum": [
"string",
"timestamp",
"timestamp_runtime"
],
"example": "timestamp_runtime"
},
"value": {
"description": "カスタム変数名を展開する値を指定します。
\nカスタム変数タイプがstringのときのみ有効です。\n",
"type": "string",
"example": "jobs"
},
"quantity": {
"type": "integer",
"format": "int64",
"description": "unit 時間の数を指定します。
\nカスタム変数タイプがtimestampかtimestamp_runtime のときのみ有効です。\n",
"example": 1
},
"unit": {
"description": "時間の単位を指定します。
\nタイプがtimestampかtimestamp_runtime のときのみ有効です。
\nmonth_start: 当月月初、month_end: 当月月末、prev_month_end: 前月末 を指定した場合、quantity・direction は不要です。\n",
"type": "string",
"enum": [
"minute",
"hour",
"date",
"month",
"month_start",
"month_end",
"prev_month_end"
],
"example": "hour"
},
"direction": {
"description": "時間軸の方向です。
\nago: 前
\nlater: 後
\nタイプがtimestampかtimestamp_runtime のときのみ有効です。\n",
"type": "string",
"enum": [
"ago",
"later"
],
"example": "ago"
},
"format": {
"type": "string",
"description": "日付フォーマットです。
\nタイプがtimestampかtimestamp_runtime のときのみ有効です。\n",
"example": "%Y-%m-%d %H:%M:%S"
},
"time_zone": {
"description": "日付フォーマットの日時を解釈するタイムゾーンです。
\nタイプがtimestampかtimestamp_runtime のときのみ有効です。\n",
"type": "string",
"example": "Etc/UTC"
}
},
"required": [
"name",
"type"
]
}
},
"datamart_bigquery_option": {
"description": "BigQueryの設定です。
\nデータウェアハウスタイプがBigQueryの場合にのみ、この値は返されます。\n",
"allOf": [
{
"title": "DatamartBigqueryOption",
"type": "object",
"properties": {
"bigquery_connection_id": {
"description": "BigQueryの接続IDです。",
"type": "integer",
"format": "int64"
},
"query_mode": {
"description": "クエリ実行モードです。
\ninsert: データ転送モード
\nquery: 自由記述モード\n",
"type": "string",
"enum": [
"insert",
"query"
]
},
"query": {
"description": "実行クエリです。",
"type": "string",
"example": "select * from tests"
},
"destination_dataset": {
"description": "出力先データセットです。
\nquery_modeがinsertの場合のみ有効です。\n",
"type": "string"
},
"destination_table": {
"description": "出力先テーブルです。
\nquery_modeがinsertの場合のみ有効です。\n",
"type": "string"
},
"write_disposition": {
"description": "書き込みモードです。
\nquery_modeがinsertの場合のみ有効。
\nappend: 追記
\ntruncate: 全件洗い替え
\nincremental: 増分更新
\nscd_type_2: SCD Type 2(履歴保持)\n",
"type": "string",
"enum": [
"append",
"truncate",
"incremental",
"scd_type_2"
]
},
"schema_evolution_mode": {
"description": "スキーマ自動追従モードです。
\nwrite_dispositionがincrementalまたはscd_type_2の場合に有効です。
\ndetect_only: 検知のみ
\nauto_add_column: カラム自動追加\n",
"type": "string",
"enum": [
"detect_only",
"auto_add_column"
]
},
"merge_keys": {
"description": "キーカラムです。レコードを一意に識別するキーを指定します。
\nwrite_dispositionがincrementalまたはscd_type_2の場合に必須です。\n",
"type": "array",
"items": {
"type": "string"
}
},
"on_matched_action": {
"description": "キーが一致するレコードが存在した場合の挙動です。
\nwrite_dispositionがincrementalの場合に必須です。
\nupsert: 上書き(既存のレコードを一旦DELETEしてから、新しいレコードをINSERTします。データの整合性を重視します。)
\nskip: スキップ(既存のレコードをそのまま残し、新しいレコードだけをINSERTします。)\n",
"type": "string",
"enum": [
"upsert",
"skip"
]
},
"incremental_column": {
"description": "増分基準カラムです。
\nwrite_dispositionがscd_type_2の場合に必須です。\n",
"type": "string"
},
"valid_from_column": {
"description": "SCD Type 2の有効開始日カラム名です。
\nwrite_dispositionがscd_type_2の場合に設定されます。固定値: trocco_valid_from\n",
"type": "string"
},
"valid_to_column": {
"description": "SCD Type 2の有効終了日カラム名です。
\nwrite_dispositionがscd_type_2の場合に設定されます。固定値: trocco_valid_to\n",
"type": "string"
},
"is_current_column": {
"description": "SCD Type 2の現在フラグカラム名です。
\nwrite_dispositionがscd_type_2の場合に設定されます。固定値: trocco_is_current\n",
"type": "string"
},
"lookback_period_column": {
"description": "処理対象期間の基準カラム名です。
\n全データを対象にする場合はlookback_period関連のパラメーターはすべて未指定になります。
\n指定されている場合はlookback_period_column_typeも設定されます。
\nwrite_dispositionがincrementalまたはscd_type_2の場合に有効です。\n",
"type": "string"
},
"lookback_period_column_type": {
"description": "処理対象期間カラムのデータ型です。
\nwrite_dispositionがincrementalまたはscd_type_2の場合に有効です。\n",
"type": "string",
"enum": [
"TIMESTAMP",
"DATETIME",
"DATE"
]
},
"lookback_period_timezone": {
"description": "処理対象期間のタイムゾーンです。
\nwrite_dispositionがincrementalまたはscd_type_2の場合に有効です。\n",
"type": "string"
},
"lookback_period_from": {
"description": "処理対象期間の開始値です。
\n指定されている場合はlookback_period_unit、lookback_period_timezoneも設定されます。
\nwrite_dispositionがincrementalまたはscd_type_2の場合に有効です。\n",
"type": "integer"
},
"lookback_period_to": {
"description": "処理対象期間の終了値です。
\n指定されている場合はlookback_period_unit、lookback_period_timezoneも設定されます。
\nwrite_dispositionがincrementalまたはscd_type_2の場合に有効です。\n",
"type": "integer"
},
"lookback_period_unit": {
"description": "処理対象期間の単位です。
\nwrite_dispositionがincrementalまたはscd_type_2の場合に有効です。
\ndays: 日
\nhours: 時間\n",
"type": "string",
"enum": [
"days",
"hours"
]
},
"before_load": {
"description": "転送前に実行するクエリです。
\nquery_modeがinsertの場合のみ有効です。\n",
"type": "string",
"example": "DELETE FROM tests"
},
"partitioning": {
"description": "パーティションタイプです。
\nquery_modeがinsertの場合のみ有効です。
\ningestion_time: 取り込み時間により分割
\ntime_unit_column: フィールドにより分割\n",
"type": "string",
"enum": [
"ingestion_time",
"time_unit_column"
]
},
"partitioning_time": {
"description": "分割する期間の単位です。
\nquery_modeがinsertの場合のみ有効です。\n",
"type": "string",
"enum": [
"DAY",
"HOUR",
"MONTH",
"YEAR"
]
},
"partitioning_field": {
"description": "分割するフィールド名です。
\nquery_modeがinsertの場合のみ有効です。\n",
"type": "string"
},
"clustering_fields": {
"description": "クラスタ化列です。
\nquery_modeがinsertの場合のみ有効です。\n",
"type": "array",
"minItems": 0,
"maxItems": 4,
"items": {
"type": "string"
}
},
"location": {
"description": "データ処理ローケーションです。
\nquery_modeがqueryの場合のみ有効です。\n",
"type": "string"
},
"table_description": {
"description": "出力先テーブルの説明です。
\nquery_modeがinsertの場合のみ有効です。設定されている場合のみ返却されます。\n",
"type": "string"
},
"column_descriptions": {
"description": "出力先テーブルのカラム説明です。
\nquery_modeがinsertの場合のみ有効です。設定されている場合のみ返却されます。
\n(設定された順。作成・更新時に指定した配列の順序を保持して返却されます)\n",
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"description": "カラム名です。",
"type": "string"
},
"description": {
"description": "カラムの説明です。",
"type": "string"
}
}
}
},
"quality_check_enabled": {
"description": "品質チェックが有効かどうかです。
\nquery_modeがinsertの場合のみ有効です。
\nquality_check_enabledがtrueの場合のみ、quality_check_*およびquality_checksが返却されます。\n",
"type": "boolean"
},
"quality_check_on_violation": {
"description": "品質チェック違反時の挙動です。
\nfail: ジョブを失敗させる
\nwarn: 警告のみ(ジョブは成功扱い)\n",
"type": "string",
"enum": [
"fail",
"warn"
]
},
"quality_check_lookback_period_column": {
"description": "品質チェック対象期間の基準カラム名です。
\n全データを対象にする場合はquality_check_lookback_period関連のパラメーターはすべて未指定になります。
\n指定されている場合はquality_check_lookback_period_column_typeも設定されます。\n",
"type": "string"
},
"quality_check_lookback_period_column_type": {
"description": "品質チェック対象期間の基準カラムのデータ型です。",
"type": "string",
"enum": [
"TIMESTAMP",
"DATETIME",
"DATE"
]
},
"quality_check_lookback_period_timezone": {
"description": "品質チェック対象期間のタイムゾーンです。",
"type": "string"
},
"quality_check_lookback_period_from": {
"description": "品質チェック対象期間の開始値です。
\n指定されている場合はquality_check_lookback_period_unit、quality_check_lookback_period_timezoneも設定されます。\n",
"type": "integer"
},
"quality_check_lookback_period_to": {
"description": "品質チェック対象期間の終了値です。
\n指定されている場合はquality_check_lookback_period_unit、quality_check_lookback_period_timezoneも設定されます。\n",
"type": "integer"
},
"quality_check_lookback_period_unit": {
"description": "品質チェック対象期間の単位です。
\ndays: 日
\nhours: 時間\n",
"type": "string",
"enum": [
"days",
"hours"
]
},
"quality_checks": {
"description": "品質チェック項目の配列です。
\n(作成・更新時に指定した配列の順序を保持して返却されます)\n",
"type": "array",
"items": {
"type": "object",
"properties": {
"check_type": {
"description": "チェック種別です。
\nnot_null: NOT NULL チェック
\nunique: UNIQUE チェック
\ncomposite_unique: 複合カラム一意性チェック\n",
"type": "string",
"enum": [
"not_null",
"unique",
"composite_unique"
]
},
"column_names": {
"description": "チェック対象カラム名の配列です。",
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
},
{
"required": [
"bigquery_connection_id",
"query_mode",
"query"
]
},
{
"nullable": true
}
]
},
"created_at": {
"description": "データマート定義の作成日時です。タイムゾーンはJST 日本時間(GMT+9)です。",
"type": "string",
"example": "2023-08-22T18:00:00+00:00"
},
"updated_at": {
"description": "データマート定義の更新日時です。タイムゾーンはJST 日本時間(GMT+9)です。",
"type": "string",
"example": "2023-08-22T18:00:00+00:00"
}
},
"required": [
"id",
"name",
"data_warehouse_type",
"is_runnable_concurrently",
"created_at",
"updated_at"
]
}
}
}
},
"400": {
"description": "Bad request.
\n不正なリクエストです。\n"
},
"401": {
"description": "Not authenticated.
\n認証エラーです。API KEYをご確認ください。\n"
}
}
}
}
},
"components": {
"securitySchemes": {
"ApiKeyAuth": {
"type": "apiKey",
"in": "header",
"name": "Authorization",
"description": "認証キーとなるAPI KEYをAuthorization: Token {{API KEY}}の形式でヘッダーにセットします。
\nAPI KEYがabc123の場合は、Authorization: Token abc123とします。
\nAPI KEYの作成方法は、TROCCO API KEYの作成を参照ください。\n"
}
}
}
}
````