Skip to content

Instantly share code, notes, and snippets.

@eiichi-worker
Last active October 30, 2018 15:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eiichi-worker/9b3b6530b641ab434971e6f72f134f06 to your computer and use it in GitHub Desktop.
Save eiichi-worker/9b3b6530b641ab434971e6f72f134f06 to your computer and use it in GitHub Desktop.
DigdagからTDのOutput results的なことをする

DigdagからTDのOutput results的なことをする

TD上のOutput results相当の指定が出来る
result_connectionとresult_settingsで指定する

+task:
    td>: queries/treasuredata/test.hive.sql
    engine: hive
    result_connection: connection_a
    result_settings:
      database: test_db
      table: test_table
      mode: update
      keys: id,date

クエリの結果を直接指定のDBなりに突っ込める。素敵。 色々機能あるのに公式ドキュメントが少し簡素。。もう少し例を書いてほしいなぁ。

@y-ken
Copy link

y-ken commented Oct 30, 2018

TDから別アカウントのTDへ書き出すような時には、次のようにすると動きました。

+task:
    td>: queries/task.sql
    engine: presto
    result_connection: connection_b
    result_settings:
      user_database_name: test_db
      user_table_name: test_table
      mode: append

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment