{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/ja/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"CLIを使用したThe Trade Deskインポート連携","description":"Treasure Data Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"cliを使用したthe-trade-deskインポート連携","__idx":0},"children":["CLIを使用したThe Trade Deskインポート連携"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"treasure-data-toolbeltのインストール","__idx":1},"children":["Treasure Data Toolbeltのインストール"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["最新の",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://toolbelt.treasuredata.com/"},"children":["Treasure Data Toolbelt"]},"をインストールしてください。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"設定ファイルloadymlの作成","__idx":2},"children":["設定ファイル（load.yml）の作成"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["設定ファイルには、The Trade Deskからコネクタに取り込まれるものを指定するin:セクションと、コネクタがTreasure Dataのデータベースに出力するものを指定するout:セクションが含まれます。利用可能なoutモードの詳細については、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/int/the-trade-desk-import-integration"},"children":["付録"]},"を参照してください。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["以下の例は、Advertiserのインポート指定方法を示しています。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"in:\n  type: the_trade_desk\n  login_credential: login_credential\n  password: password\n  target: advertiser\nout:\n  mode: append\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["以下の例は、Campaignのインポート指定方法を示しています。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"in:\n  type: the_trade_desk\n  login_credential: login_credential\n  password: password\n  target: campaign\n  advertiser_id: advertiser_id1, advertiser_id2, advertiser_id3\nout:\n mode: append\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["以下の例は、Data Groupのインポート指定方法を示しています。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"in:\n  type: the_trade_desk\n  login_credential: login_credential\n  password: password\n  target: data_group\n  advertiser_id: advertiser_id1, advertiser_id2, advertiser_id3\nout:\n mode: append\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["以下の例は、Tracking Tagsのインポート指定方法を示しています。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"in:\n  type: the_trade_desk\n  login_credential: login_credential\n  password: password\n  target: tracking_tags\n  advertiser_id: advertiser_id1, advertiser_id2, advertiser_id3\nout:\n mode: append\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"インポートするデータのプレビューオプション","__idx":3},"children":["インポートするデータのプレビュー（オプション）"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["td connector:previewコマンドを使用してインポートするデータをプレビューできます。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"$ td connector:preview load.yml\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"ロードジョブの実行","__idx":4},"children":["ロードジョブの実行"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ジョブを実行するには、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td connector:issue"]}," を使用します。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ロードジョブを実行する前に、データを保存するデータベースとテーブルを指定する必要があります。例：td_sample_db、td_sample_table"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"$ td connector:issue load.yml \\\n     --database td_sample_db \\\n     --table td_sample_table \\\n     --time-column date_time_column\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Treasure Data のストレージは時間によってパーティション分割されるため、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--time-column"]}," オプションを指定することを推奨します。このオプションが指定されていない場合、データコネクタは最初の long 型または timestamp 型のカラムをパーティション時刻として選択します。",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--time-column"]}," で指定するカラムの型は、long 型または timestamp 型である必要があります（使用可能なカラム名と型を確認するには、プレビュー結果を使用してください。一般的に、ほとんどのデータ型には last_modified_date カラムがあります）。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["データに時刻カラムがない場合は、add_time フィルターオプションを使用してカラムを追加できます。詳細は ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://support.treasuredata.com/hc/en-us/articles/360001405587-add-time-filter-plugin-for-Data-Connector"},"children":["add_time filter"]}," プラグインを参照してください。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td connector:issue"]}," は、データベース（sample_db）とテーブル（sample_table）が既に作成されていることを前提としています。データベースまたはテーブルが TD に存在しない場合、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td connector:issue"]}," は失敗します。したがって、データベースとテーブルを手動で作成するか、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td connector:issue"]}," で ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--auto-create-table"]}," を使用してデータベースとテーブルを自動的に作成する必要があります。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"$ td connector:issue load.yml \\\n      --database td_sample_db \\\n      --table td_sample_table \\\n      --time-column date_time_column \\\n      --auto-create-table\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["コマンドラインからロードジョブを送信します。データサイズによっては、処理に数時間かかる場合があります。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"付録","__idx":5},"children":["付録"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"out-プラグインのモード","__idx":6},"children":["out プラグインのモード"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["load.yml ファイルの out セクションでファイルインポートモードを指定できます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["out: セクションは、データを Treasure Data テーブルにインポートする方法を制御します。"," ","たとえば、Treasure Data の既存のテーブルにデータを追加するか、データを置換するかを選択できます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["出力モードは、データが Treasure Data に配置されるときにデータを変更する方法です。"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Append"]},"（デフォルト）：レコードがターゲットテーブルに追加されます。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Replace"]},"（td 0.11.10 以降で利用可能）：ターゲットテーブルのデータを置き換えます。ターゲットテーブルに対して行われた手動のスキーマ変更はそのまま残ります。"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["例："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"in:\n  ...\nout:\n  mode: append\nin:\n  ...\nout:\n  mode: replace\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"無効な-id-のエラーハンドリング","__idx":7},"children":["無効な ID のエラーハンドリング"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ユーザーが無効な ID（広告主 ID）の文字列を入力すると、最初の無効な ID が検出され、エラーメッセージが表示されます。無効な ID が最初の ID でない場合、無効な ID は検出されず、ジョブは実行されますが、無効な ID は出力ログに表示されます。"]}]},"headings":[{"value":"CLIを使用したThe Trade Deskインポート連携","id":"cliを使用したthe-trade-deskインポート連携","depth":1},{"value":"Treasure Data Toolbeltのインストール","id":"treasure-data-toolbeltのインストール","depth":2},{"value":"設定ファイル（load.yml）の作成","id":"設定ファイルloadymlの作成","depth":2},{"value":"インポートするデータのプレビュー（オプション）","id":"インポートするデータのプレビューオプション","depth":2},{"value":"ロードジョブの実行","id":"ロードジョブの実行","depth":2},{"value":"付録","id":"付録","depth":1},{"value":"out プラグインのモード","id":"out-プラグインのモード","depth":2},{"value":"無効な ID のエラーハンドリング","id":"無効な-id-のエラーハンドリング","depth":2}],"frontmatter":{"seo":{"title":"CLIを使用したThe Trade Deskインポート連携"}},"lastModified":"2026-01-09T05:58:30.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ja/int/the-trade-desk-import-integration-using-cli","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}