有人暗示如何将四列的值放入Google BigQuery的新列中?标准SQL方言。不是遗产。如果我尝试连续(在select语句中或作为子选择)
SELECT
Concat (visitId,fullVisitorId,visitNumber) as identifier,
...
FROM ...
SELECT
(SELECT Concat(visitId,fullVisitorId,visitNumber) as identifier FROM ...),
...
FROM ...
我收到如下错误消息:
Error: No matching signature for function CONCAT for argument types: INT64, STRING, INT64. Supported signatures: CONCAT(STRING, [STRING, ...]); CONCAT(BYTES, [BYTES, ...]) at [5:3]
如果有人可以帮助我,那就太好了。感谢。
答案 0 :(得分:5)
你有没有尝试在concat之前投射它们:
SELECT Concat(cast(visitId as string), cast(fullVisitorId as string), cast(visitNumber as string)) as identifier,
我不知道你想对结果做什么。但是,将值放入数组或结构中可能更有意义。通常,您不需要将值组合成字符串,因为可以使用更复杂的类型。