LoginSignup
4
2

More than 5 years have passed since last update.

embulk で BQ in BQ out で Partitioned tables に躓いた

Posted at

やりたいこと

Embulk で BigQuery -> BigQuery がやりたい。
out側のテーブルは Partitioned tables としたい(DATE型またはTIMESTAMP型のカラムを指定)

やったこと

embulk-input-bigquery
embulk-output-bigquery
を用いて、実行したが、どうも Partitioned tables だとうまく動かない。

あらかじめ out側の BigQuery で以下のようなものを実行して Partitioned tables を作成しておく。

CREATE TABLE mydataset.newtable (transaction_id INT64, transaction_date DATE)
PARTITION BY TIMESTAMP(transaction_date)

in側で TIMESTAMP型のカラムを作り、out側に流してみたものの Partition 絡みでエラーがでてしまい実行できなかった。
おそらく embulk-output-bigquery が Partitioned tables に対応しないとダメそう。
Tables partitioned by ingestion time の方には対応しているので、今回はそちらで対応することにした。
もちろん前の記事のように Cloud Dataflow など使えば問題なくできる。

4
2
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
4
2