0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Google App ScriptでBigQuery使おうとしてハマったこと

Posted at

https://qiita.com/satoru_mag/items/114703d7d95b60b11c6f
この方の記事を参考にやってたけど

Try using standard SQL
だの
Querying tables partitioned on a field is not supported in Legacy SQL
だのいろいろ怒られて困ってました。

標準SQLを調べて書いても全然うまくいかず、
BigQueryの方でレガシーSQLを受け付ける設定をしたりしてもだめ、
レガシーSQLじゃなくて標準SQLで書いてんだろ!と思いながらいろいろ調べてると

SQLを

var sql = "SELECT aaa FROM `hoge.fuga.table` WHERE ***";

みたいにテーブルを`で囲い

  var resource = {
    query : sql,
    timeoutMs: 1000000
  };

この部分を

    query : sql,
    useLegacySql: false,
    timeoutMs: 1000000
  };

こうしたら解決!
明示的に指定しなければいけなかったんですね。

そういえば転職してから初めての記事なので会社を宣伝しておきます!
とってもいい人たちに囲まれてリモートワークを(どっちだよ)愛知からエンジョイしています!
カジュアルに面談もやっていますのでどうぞ!
https://www.wantedly.com/companies/media-engine

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?