LoginSignup
0
0

More than 1 year has passed since last update.

【Embulk】embulk-output-postgresqlで任意のカラムを追加する。

Posted at

実施したいこと

  • embulk-output-postgresqlで出力先のテーブルに、システム日付が自動で設定されたcreated_atと固定文字列が設定されたカラムを追加したい。

必要なプラグイン

  • embulk-filter-column
  • embulk-filter-eval

設定方法:created_atを追加する

  • config.ymlに以下の記述を追加する。(一度、defaultの値を設定して書き換えるような記述をするらしい。)
config.yml
filters:
  - type: column
    add_columns:
      - {name: created_at, type: timestamp, default: '19000101', format: "%Y%m%d" , timezone: "+09:00"}
  - type: eval
    eval_columns:
     - created_at: Time.now

設定方法:固定文字列のカラムを追加する。

  • config.ymlに以下の記述を追加する。
config.yml
filters:
  - type: column
    add_columns:
      - {name: hoge_column, type: string, default: 'hogehoge' }
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0