LoginSignup
1
1

More than 3 years have passed since last update.

td-client-python を使って CREATE TABLE を実行する場合の注意点

Posted at

Python3 で td-client-python のクエリ実行機能を使ってテーブル作成を行う場合、以下のような書き方だとテーブルは作成されません。

job = client.query('sample_database', 'CREATE TABLE IF NOT EXISTS sample_table (time BIGINT, column1 STRING, column2 INT, column3 STRING)')

手元の環境は以下になります。

  • Ubuntu 18.04 LTS
  • Python 3.7.0
  • td-client==0.13.0

この場合、type に presto を指定してあげるとテーブル作成できます。

job = client.query('sample_database', 'CREATE TABLE IF NOT EXISTS sample_table (time BIGINT, column1 VARCHAR, column2 INT, column3 VARCHAR)', type='presto')

参考になった記事

TreasureData:HiveQLのCREATE TABLEでエラーが出たら

1
1
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
1
1