{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/ja/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"type":"markdown"},"seo":{"title":"Amazon Redshift Export Integration","description":"Treasure AIから Amazon Redshift へのデータエクスポート方法を解説。対応リージョン、設定手順、制限事項について詳しく説明します。","siteUrl":"https://docs.treasure.ai","lang":"en-US","jsonLd":{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.treasure.ai/","name":"Treasure AI","url":"https://www.treasure.ai/","logo":"https://www.treasure.ai/hubfs/assets/images/logos/primary-logo.svg"},{"@type":"WebSite","@id":"https://docs.treasure.ai/#website","name":"Treasure AI Documentation","url":"https://docs.treasure.ai/","inLanguage":["en","ja"],"publisher":{"@id":"https://www.treasure.ai/"}}]},"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":"amazon-redshift-export-integration","__idx":0},"children":["Amazon Redshift Export Integration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["既存のAmazon Redshift clusterにjobの結果を書き込むことができます。Exportに関するAmazon Redshiftのサンプルworkflowについては、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/treasure-data/treasure-boxes/tree/master/td/redshift"},"children":["Treasure Boxes"]},"を参照してください。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"前提条件","__idx":1},"children":["前提条件"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["TD Toolbeltを含むTreasure Dataの基本的な知識"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["実行中の",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Amazon Redshift cluster"]},"のセットアップ - シングルノードまたはマルチノードcluster"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["queryを実行するTreasure Data tableに対する少なくとも'Query only'権限"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"制限事項","__idx":2},"children":["制限事項"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Redshiftに結果をエクスポートする際、Redshiftは宛先tableがすでに存在する場合、カラムタイプの変換を試みます。変換中にカラムがNULLになり、Redshift上のカラムがNOT NULLフィールドの場合、すべてのレコードが拒否されます。これは、Redshiftへの結果エクスポートのjobが成功した場合でも発生する可能性がありますが、Redshiftにはデータが取り込まれません。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["このconnectorは、timestamp/dateタイプのデータをサポートしていません。このタイプのデータをstringカラムまたはUnix timestampに変換する必要があります。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"サポートされているregion","__idx":3},"children":["サポートされているRegion"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Result Output to Redshiftは、いくつかのregionにデータをエクスポートできます。以下はサポートされているregionです:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["us-east-1 (US Standard)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["us-west-2 (Oregon)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["eu-west-1 (Ireland)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["ap-northeast-1 (Tokyo)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["us-west-1 (N. California)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["ap-southeast-1 (Singapore)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["ap-southeast-2 (Sydney)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["sa-east-1 (São Paulo)"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["以下のregionはサポートされていません:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["us-east-2 (Ohio)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["ap-south-1 (Mumbai)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["ap-northeast-2 (Seoul)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["ca-central-1 (Central)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["eu-central-1 (Frankfurt)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["eu-west-2 (London)"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["サポートしたい他のregionがある場合は、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.treasuredata.com/smart/project-product-documentation/contacting-treasure-data-support"},"children":["Treasure Data supportに連絡"]},"してください。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"treasure-data-integration-の静的-ip-アドレス","__idx":4},"children":["Treasure Data Integration の静的 IP アドレス"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["セキュリティポリシーで IP ホワイトリストが必要な場合は、接続を成功させるために Treasure Data の IP アドレスを許可リストに追加する必要があります。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["リージョンごとに整理された静的 IP アドレスの完全なリストは、次のリンクにあります:"," ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/endpoints/ip-addresses-integrations-result-workers"},"children":["IP Addresses for Integrations"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"amazon-redshift-configuration","__idx":5},"children":["Amazon Redshift Configuration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Amazon Redshiftは、シングルノードモードまたはマルチノード/clusterモードで設定できます。マルチノード構成は、利用可能なノード上でのquery実行の並列化により、より多くのquery計算能力を提供します。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"treasure-コンソールを使用してconnectionを作成","__idx":6},"children":["Treasure コンソールを使用してConnectionを作成"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"新しいauthenticationの作成","__idx":7},"children":["新しいAuthenticationの作成"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Treasure Dataでは、queryを実行する前にデータconnectionを作成して設定する必要があります。データconnectionの一部として、integrationにアクセスするためのauthenticationを提供します。"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Treasure コンソール"]},"を開きます。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Integrations Hub"]}," > ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Catalog"]},"に移動します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Catalog画面の右端にある検索アイコンをクリックし、",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Amazon Redshift"]},"と入力します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Amazon Redshift connectorにカーソルを合わせ、",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create Authentication"]},"を選択します。"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/amazonredshift.72b30214eceebe7b0fea54137a0622f0286279c4112f82ec8cef094f631cb6ae.0edad2c5.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["認証するcredentialsを入力します。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image2021-3-1_14-40-15.e7a57af257de8db9efedfdd4cef6ca2b742481ac5db98f0cbe2c5254c0aeb12c.0edad2c5.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Value"},"children":["Value"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Host"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["source databaseのhost情報(IPアドレスなど)。Redshift設定ページから取得できます。通常、形式は次のとおりです:name.<instance_id>.region.redshift.amazonaws.com。nameはclusterに提供されたもの、instance idはcluster作成時にAmazon Redshiftによって自動生成されます、regionは選択したAmazon availability zoneです。hostnameの代わりにIPアドレスを使用している場合は、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["region"]},"オプションを明示的に設定する必要があります。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Port"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["sourceインスタンス上の接続port。PostgreSQLのデフォルトは5432です。Redshift serverにアクセスするためのport番号。\":\"はオプションで、デフォルトでは5439と想定されます。マルチノードcluster設定では異なる場合があります。実際の値は、Redshift clusterの詳細ページから取得できます。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["User"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["source databaseに接続するためのUsername。Amazon RedshiftインスタンスのCredentials。これらのcredentialsは、Redshift clusterを最初に作成するときに指定され、S3 public/private access keysとは異なります。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Password"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["source databaseに接続するためのpassword。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Use SSL"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SSLを使用して接続する場合は、このボックスにチェックを入れます"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["JDBC Connection options"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["source databaseに必要な特別なJDBC接続(オプション)。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Region"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Redshiftインスタンスがホストされているaws region。Redshiftインスタンスが配置されているregionを指定します。hostnameにregion名が含まれていない場合、このオプションが必要です。redshift://user:password@host/database/table?region=us-east-1"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Socket connection timeout"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["socket接続のタイムアウト(秒単位)(デフォルトは300)。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Network timeout"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["network socketオペレーションのタイムアウト(秒単位)。0はタイムアウトなしを意味します。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Rows per batch"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["一度に取得する行数。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Options"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["JDBC driverに与えたいOptions。",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/aws/amazon-redshift-jdbc-driver?tab=readme-ov-file#installation-and-configuration-of-driver"},"children":["Installing Redshift JDBC Driver"]},"を参照してください。",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["例えば、これらのパラメータと値のフィールドを使用して、LogLevelやLogPathなどのさまざまなURLオプションを定義できます。jdbc:redshift://company.us-west1.redshift.amazonaws.com:9000/Default;LogLevel=3;LogPath =C:\temp "]},"Redshiftへのresult outputは、オプションのURLパラメータとして指定できるさまざまなオプションをサポートしています。これらのオプションは互いに互換性があり、組み合わせることができます。該当する場合、デフォルトの動作が示されます。SSL Option ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["ssl"]},"オプションは、Redshiftに接続する際にSSLを使用するかどうかを決定します。",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ssl=true"]}," Treasure DataからRedshift接続にSSLを使用します。",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["redshift://user:password@host/database/table?ssl=true"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ssl=false"]},"(デフォルト)Treasure DataからRedshiftにSSLを使用しません。",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["redshift://user:password@host/database/table?ssl=false"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":8},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["必要な接続の詳細を入力した後、",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Continue"]},"を選択します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["後でconnectionの詳細を変更する必要がある場合に見つけられるように、connectionに名前を付けます。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["オプションで、組織内の他のユーザーとこのconnectionを共有したい場合は、",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Share with others"]},"を選択します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Done"]},"を選択します。"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"queryの定義","__idx":8},"children":["Queryの定義"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.treasuredata.com/smart/project-product-documentation/creating-a-destination-integration"},"children":["Creating a Destination Integration"]},"の指示を完了します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Data Workbench > Queries"]},"に移動します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["データをエクスポートするqueryを選択します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["queryを実行して、結果セットを検証します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Export Results"]},"を選択します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["既存のintegration authenticationを選択します。"," ",{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image2020-12-18_13-44-6.09e8af43184e33e337bef7c546600eaaa5be9f010b690af1d591c7c2b4bb2df3.c27c97ee.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["追加のExport Resultsの詳細を定義します。export integrationコンテンツで、integrationパラメータを確認します。"," ","例えば、Export Results画面は異なる場合があり、入力する追加の詳細がない場合もあります:"," ",{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image2023-5-17_14-42-52.d2483b20e117c4abf1aaa32c5071595644e4c6b9d987ef4ea4ce4a2038171b85.c27c97ee.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Done"]},"を選択します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["queryを実行します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["データが指定した宛先に移動したことを検証します。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"redshiftのintegration-parameters","__idx":9},"children":["RedshiftのIntegration Parameters"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image2021-3-2_16-49-44.a46c316ca063ddebba7e30d47d889873237d2845170b127f8300ef13eceba64e.0edad2c5.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Values"},"children":["Values"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Database"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["データをエクスポートするdatabaseの名前。Redshift clusterの作成時に指定されたdatabaseの名前。Redshift clusterの詳細ページから取得できます。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Table"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["データをエクスポートするdatabase内のtableの名前。database内のtableの名前。query出力が実行されるときに存在しない場合があります。tableが存在しない場合、指定された名前のtableが作成されます。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Mode"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["append"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["replace"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["truncate"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["update"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["databaseデータを変更するさまざまな方法を制御します。",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Append Mode"]},": これがデフォルトモードです。queryの結果がcollectionに追加されます。collectionがまだ存在しない場合、新しいcollectionが作成されます。このメソッドは",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.treasuredata.com/smart/project-product-documentation/glossary/a/atomicity"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["atomic"]}]},"ではありません"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Replace Mode"]},": ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["replace"]},"モードは、既存のtableのすべてのコンテンツをqueryの結果出力で置き換えることで構成されます。tableが存在しない場合、新しいtableが作成されます。最速の結果を得るには、RDS database tableに対して一度に1つの",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["write"]},"接続のみを開くことをお勧めします。replaceモードは、",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["単一のトランザクション"]},"で以下の手順を実行することにより、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.treasuredata.com/smart/project-product-documentation/glossary/a/atomicity"},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["atomicity"]}]},"(tableのconsumerが常に一貫したデータを持つように)を達成します:1. temporary tableを作成する;2. temporary tableに書き込む;3. ALTER TABLE RENAMEを使用して既存のtableをtemporary tableで置き換える。最速の結果を得るには、RDS database tableに対して一度に1つの**write**接続のみを開くことをお勧めします。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Truncate Mode"]},": Truncateモードは、tableのindexを保持します。",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["truncate"]},"モードでは、システムはまず既存のtableをtruncateしてすべてのレコードを削除し、次にtableのschemaを変更せずに既存のtableにqueryの結果を挿入します。結果出力tableに、宛先tableのschemaと名前またはタイプ(またはその両方)が一致しないカラムが含まれている場合、そのカラムは削除され、宛先tableに書き込まれません。宛先tableが存在しない場合、これは問題ではありません:結果出力tableのschemaと一致するschemaで新しいtableが作成されます。truncateモードはtemporary tableを使用するため、書き込みの",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["atomicity"]},"を達成します。replaceとは異なり、truncateモードはtableのindexを保持します。",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Update Mode"]},": ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["update"]},"モードでは、\"unique\"パラメータで指定されたカラムに重複した値を引き起こす場合を除いて、行が挿入されます。そのような場合、代わりに更新が実行されます。updateモードを使用する場合、uniqueパラメータが必要です。tableが存在しない場合、作成されます。このモードは、実際の宛先tableにデータを挿入する前に、受信データを保存するためにtemporary tableを使用するため、",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["atomic"]},"です。"]}]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["In-place append"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["select  clear"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["コピーするのではなく、既存のデータを変更するために選択します。これにより、大幅なパフォーマンス向上が得られます。",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["mode=append"]},"の場合、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["inplace"]},"マイナーオプションでアクションのatomicityを制御できます。",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]},"の場合、temporary tableは使用されず、operationはatomicであることが保証されません。オプションが",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]},"の場合、temporary tableが使用されます。デフォルト値はtrueです。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Schema"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ターゲットtableが配置されているschemaを制御します。指定されていない場合、デフォルトのschemaが使用されます。デフォルトのschemaは、ユーザーの\"search_path\"設定に依存しますが、通常は\"public\"です。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Method"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["copy  bulk copy"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["copy"]},"(デフォルト)このオプションを使用すると、COPY Redshift SQLコマンドを使用して、異なるフローでデータをエクスポートできます。**",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["bulk_copy"]},"**このオプションは",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["copy"]},"コマンドを使用しますが、異なるフローを使用します。Treasure DataからSSLを使用してRedshift接続をインスタンス化できます。例:",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["redshift://user:password@host/database/table?method=bulk_copy"]},"。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Serial Copy"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["select  clear"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["serial_copy"]},"オプションは、並列にファイルをアップロードするときに発生する可能性のあるデッドロックを回避するために、すべてのファイルを1つずつ順番にアップロードするかどうかを決定します。",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["serial_copy=true"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["serial_copy=false"]},"(デフォルト)"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"example-query","__idx":10},"children":["Example Query"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"SQL","header":{"controls":{"copy":{}}},"source":"select * from an_redshift_data limit 800000000\n","lang":"SQL"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"audience-studio-で-segment-をアクティベートする","__idx":11},"children":["Audience Studio で Segment をアクティベートする"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Audience Studio で activation を作成することで、segment データをターゲットプラットフォームに送信することもできます。"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Audience Studio"]}," に移動します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["parent segment を選択します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["ターゲット segment を開き、右クリックして、",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create Activation"]}," を選択します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Details"]}," パネルで、Activation 名を入力し、前述の Configuration Parameters のセクションに従って activation を設定します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Output Mapping"]}," パネルで activation 出力をカスタマイズします。"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/ouput.b2c7f1d909c4f98ed10f5300df858a4b19f71a3b0834df952f5fb24018a5ea78.8ebdf569.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Attribute Columns",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Export All Columns"]}," を選択すると、変更を加えずにすべての列をエクスポートできます。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["+ Add Columns"]}," を選択して、エクスポート用の特定の列を追加します。Output Column Name には、Source 列名と同じ名前があらかじめ入力されます。Output Column Name を更新できます。",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["+ Add Columns"]}," を選択し続けて、activation 出力用の新しい列を追加します。"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["String Builder",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["+ Add string"]}," を選択して、エクスポート用の文字列を作成します。次の値から選択します:",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["String: 任意の値を選択します。テキストを使用してカスタム値を作成します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Timestamp: エクスポートの日時。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Segment Id: segment ID 番号。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Segment Name: segment 名。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Audience Id: parent segment 番号。"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":6},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Schedule"]}," を設定します。"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/snippet-output-connector-on-audience-studio-2024-08-28.a99525173709da1eb537f839019fa7876ffae95045154c8f2941b030022f792c.8ebdf569.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["スケジュールを定義する値を選択し、オプションでメール通知を含めます。"]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":7},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create"]}," を選択します。"]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["batch journey の activation を作成する必要がある場合は、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/journey-orchestration/batch/creating-a-batch-journey-activation"},"children":["Creating a Batch Journey Activation"]}," を参照してください。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"cli-examples","__idx":12},"children":["CLI Examples"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["TD Toolbeltを使用して、Amazon Redshiftにエクスポートしたいデータを返すqueryを実行する場合:"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"cliを使用した1回限りのexport","__idx":13},"children":["CLIを使用した1回限りのExport"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td query -w -d testdb \\\n--result 'redshift://username:password@host.redshift.amazonaws.com/database/table?mode=replace' \\\n\"SELECT code, COUNT(1) FROM www_access GROUP BY code\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"cliを使用したscheduled-export","__idx":14},"children":["CLIを使用したScheduled Export"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"td sched:create hourly_count_example \"0 * * * *\" -d testdb \\\n--result 'redshift://username:password@host.redshift.amazonaws.com/database/table?mode=replace' \\\n\"SELECT COUNT(*) FROM www_access\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"troubleshooting","__idx":15},"children":["Troubleshooting"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"result-output-to-redshiftのjobが成功した場合でもredshiftがデータを取得しない場合","__idx":16},"children":["Result Output to Redshiftのjobが成功した場合でも、Redshiftがデータを取得しない場合"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Result Output to Redshiftは、宛先tableがすでに存在する場合、カラムタイプの変換を試みます。変換が失敗すると、カラムがNULLになり、Redshift上のカラムがNOT NULLフィールドの場合、すべてのレコードが拒否されます。"]}]},"headings":[{"value":"Amazon Redshift Export Integration","id":"amazon-redshift-export-integration","depth":1},{"value":"前提条件","id":"前提条件","depth":1},{"value":"制限事項","id":"制限事項","depth":1},{"value":"サポートされているRegion","id":"サポートされているregion","depth":1},{"value":"Treasure Data Integration の静的 IP アドレス","id":"treasure-data-integration-の静的-ip-アドレス","depth":2},{"value":"Amazon Redshift Configuration","id":"amazon-redshift-configuration","depth":1},{"value":"Treasure コンソールを使用してConnectionを作成","id":"treasure-コンソールを使用してconnectionを作成","depth":1},{"value":"新しいAuthenticationの作成","id":"新しいauthenticationの作成","depth":2},{"value":"Queryの定義","id":"queryの定義","depth":2},{"value":"RedshiftのIntegration Parameters","id":"redshiftのintegration-parameters","depth":2},{"value":"Example Query","id":"example-query","depth":2},{"value":"Audience Studio で Segment をアクティベートする","id":"audience-studio-で-segment-をアクティベートする","depth":2},{"value":"CLI Examples","id":"cli-examples","depth":1},{"value":"CLIを使用した1回限りのExport","id":"cliを使用した1回限りのexport","depth":2},{"value":"CLIを使用したScheduled Export","id":"cliを使用したscheduled-export","depth":2},{"value":"Troubleshooting","id":"troubleshooting","depth":2},{"value":"Result Output to Redshiftのjobが成功した場合でも、Redshiftがデータを取得しない場合","id":"result-output-to-redshiftのjobが成功した場合でもredshiftがデータを取得しない場合","depth":3}],"frontmatter":{"seo":{"title":"Amazon Redshift Export Integration","description":"Treasure AIから Amazon Redshift へのデータエクスポート方法を解説。対応リージョン、設定手順、制限事項について詳しく説明します。"}},"lastModified":"2026-06-17T07:22:53.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ja/int/amazon-redshift-export-integration","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}