如何在不破坏BigQuery Connector for Excel的情况下运行标准SQL查询?

时间:2018-08-27 00:41:14

标签: google-bigquery

我想运行以下查询。它有效并且可以在Web ui中使用

SELECT * FROM `option-optimizer.cme.3months_euro_dollar_future` 
where date = '2017-09-01'

,但是当我通过BigQuery Connector for Excel运行它时,它不起作用。它似乎无法识别标准SQL格式。这是我得到的错误。

Request failed: Error. Unable to execute query. 400 {
  "code": 400,
  "errors": [
    {
      "domain": "global",
      "location": "`option-optimizer:cme.3months_euro_dollar_future`",
      "locationType": "other",
      "message": "Invalid table name: `option-optimizer:cme.3months_euro_dollar_future`\n[Try using standard SQL (https://cloud.google.com/bigquery/docs/reference/standard-sql/enabling-standard-sql)].",
      "reason": "invalid"
    }
  ],
  "message": "Invalid table name: `option-optimizer:cme.3months_euro_dollar_future`\n[Try using standard SQL (https://cloud.google.com/bigquery/docs/reference/standard-sql/enabling-standard-sql)]."
}

除了上述错误外,我认为日期过滤器也会损坏。

1 个答案:

答案 0 :(得分:4)

要使用标准SQL运行查询,请在查询前添加以下行:

#standardSQL   

例如:

#standardSQL   
SELECT * FROM `option-optimizer.cme.3months_euro_dollar_future` 
where date = '2017-09-01'