找不到函数:group_concat [英] Function not found: group_concat
问题描述
我很有兴趣使用group_concat执行查询BigQuery功能。当我在BigQuery接口中直接执行查询时,查询成功结束,但是当我尝试通过Node js执行该查询时,出现了以下错误:
错误:
[{domain:'global',
reason:'invalidQuery',
message:'Function not found:group_concat at [4:3]' ,
locationType:'other',
location:'query'}]
代码不是问题,因为它执行一个简单的查询没有任何问题。
我的查询:
<$ p
$ _
$ b $ group_concat(group.code,'|')
GROUP BY
st_hub_session_id,
group_concat
LIMIT
1000
问题出在哪里?
STRING_AGG $ c $在标准的SQL中,而不是传统的 GRO UP_CONCAT
。您可以通过取消选中Show Options下的Use legacy SQL,或者在查询顶部放置 #standardSQL
来通过UI使用标准SQL。另请参阅启用标准SQL 。
I'm interesting in execute a query using the "group_concat" BigQuery function. When I execute the query directly in the BigQuery interface, the query ends successfully, but when I try to execute that query via Node js, the bellow error appeared:
errors:
[ { domain: 'global',
reason: 'invalidQuery',
message: 'Function not found: group_concat at [4:3]',
locationType: 'other',
location: 'query' } ]
The code is not the problem since it executes a simple query without any problem.
My query:
SELECT
st_hub_session_id,
num_requests,
group_concat( group.code, '|' ) as Codes
FROM
table.name
GROUP BY
st_hub_session_id,
group_concat
LIMIT
1000
Where could be the problem?
解决方案 Use STRING_AGG
in standard SQL instead of the legacy GROUP_CONCAT
. You can use standard SQL through the UI by unchecking "Use legacy SQL" under "Show Options" or else putting #standardSQL
at the top of your query. See also Enabling Standard SQL.
这篇关于找不到函数:group_concat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!