Insightsモデルにデータセットを作成または追加する際は、次の点を考慮してください:
- 定義。Insightsモデルの作成に使用されたYAMLファイルで定義されたのと同じスキーマを持つように定義を定義します(POST /reporting/datamodels)。
- データベース/テーブル名。データベースとテーブル名、および列情報(「type(必須、現在は「presto」のみが利用可能)」、indexed(オプション、デフォルト値:false)を含む)を指定します。
- データセット名。データセットに名前を付ける際に制限はありません。Treasure Dataは、データベースと同じ名前を使用することをお勧めします。
APIエンドポイントについては、お使いの地域に適したエンドポイントを選択してください。
curl -X POST https://${api endpoint}/reporting/datamodels/xxxxxx/datasets \
-H 'authorization: TD1 xxxx/xxxxxxxxxxxxxx' \
-H 'cache-control: no-cache' \
-H 'accept: application/json' \
-H 'content-type: application/json' \
-d '{
"name": "new_table",
"definition": {
"type": "presto",
"database": "new_db",
"tables": {
"new_table": {
"columns": {
"id": {
"type": "text",
"indexed": true
}
}
}
}
}
}'