我正在尝试在查询下运行 -
select prd_cat, product_category from
(
select split( product_category,".") as prd_cat,product_category from
test_dataset.cosme_raw_table
where product_link = "XXX"
) as a
group by prd_cat,product_category;
当我使用 BigQuery Web 界面运行它时,它运行成功,但是当我尝试使用 BigQuery Query API 运行它时,它失败并显示错误消息“[6:10] 不允许按 ARRAY 类型的表达式分组”下面是我的代码 -
String query = "select prd_cat, product_category" +
" from\n" +
"(\n" +
"select split( product_category,\".\") as prd_cat," +
"product_category " +
"from test_dataset.cosme_raw_table \n" +
"where product_link = \"XXX\"\n" +
") as a\n" +
"group by prd_cat,product_category";
QueryJobConfiguration queryJobConfiguration =
QueryJobConfiguration.newBuilder(query)
.setDestinationTable(tableId1)
.setWriteDisposition(JobInfo.WriteDisposition.WRITE_TRUNCATE)
.build();
Job loadJob1 = bigquery.create(JobInfo.of(queryJobConfiguration));
有人可以帮忙吗。谢谢!!
一只斗牛犬
慕神8447489
相关分类