0

职位声明:

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 (...).

我能做些什么?

4

1 回答 1

0

如此处所述在 java bigquery API 中使用标准 SQL 查询

一种解决方法是放在#standardSQL查询之上

于 2017-07-19T15:06:36.063 回答