UseLegacySql:忽略 JobConfigurationQuery 中的 false 选项
UseLegacySql: false option in JobConfigurationQuery is ignored
职位声明:
job, err := bqClient.Jobs.Insert(_PROJECT_ID_, &bigquery.Job{
Configuration: &bigquery.JobConfiguration{
Query: &bigquery.JobConfigurationQuery{
UseLegacySql: false,
CreateDisposition: "CREATE_IF_NEEDED",
Query: reportQuery.query,
WriteDisposition: "WRITE_TRUNCATE",
SchemaUpdateOptions: []string{"ALLOW_FIELD_RELAXATION", "ALLOW_FIELD_ADDITION"},
DestinationTable: &bigquery.TableReference{
ProjectId: _PROJECT_ID_,
DatasetId: dataset,
TableId: "name$" + reportQuery.tableDecorator,
},
},
},
}).Do()
作业完成但出现错误
2017/07/19 11:41:27 ERROR: Encountered " "WITH" "WITH "" at line 1, column 1. Was expecting: <EOF>
[Try using standard SQL (https://cloud.google.com/bigquery/docs/reference/standard-sql/enabling-standard-sql)]
查询开头有几个WITH ... AS (...)
。
我能做什么?
如此处所述
解决方法是将 #standardSQL
置于查询之上
职位声明:
job, err := bqClient.Jobs.Insert(_PROJECT_ID_, &bigquery.Job{
Configuration: &bigquery.JobConfiguration{
Query: &bigquery.JobConfigurationQuery{
UseLegacySql: false,
CreateDisposition: "CREATE_IF_NEEDED",
Query: reportQuery.query,
WriteDisposition: "WRITE_TRUNCATE",
SchemaUpdateOptions: []string{"ALLOW_FIELD_RELAXATION", "ALLOW_FIELD_ADDITION"},
DestinationTable: &bigquery.TableReference{
ProjectId: _PROJECT_ID_,
DatasetId: dataset,
TableId: "name$" + reportQuery.tableDecorator,
},
},
},
}).Do()
作业完成但出现错误
2017/07/19 11:41:27 ERROR: Encountered " "WITH" "WITH "" at line 1, column 1. Was expecting: <EOF>
[Try using standard SQL (https://cloud.google.com/bigquery/docs/reference/standard-sql/enabling-standard-sql)]
查询开头有几个WITH ... AS (...)
。
我能做什么?
如此处所述
解决方法是将 #standardSQL
置于查询之上