javascript - BIGQuery - 函数 ARRAY_TO_STRING 没有匹配的签名

标签 javascript sql google-apps-script google-bigquery

运行下面的查询后

           SELECT ARRAY_TO_STRING( reporteeNames, '|') FROM 
         `appsflow-dev.PersonRequisition.ExternalNewHire`;

我遇到了错误

error

架构

Fieldname                           Type    Mode

reporteeNames                       RECORD  REPEATED    
reporteeNames.reporteeTitle         STRING  NULLABLE    
reporteeNames.reporteeName          RECORD  NULLABLE    
reporteeNames.reporteeName.display  STRING  NULLABLE    
reporteeNames.reporteeName.value    STRING  NULLABLE

请建议针对我的模式的解决方案。

最佳答案

您需要取消嵌套数组才能选择结构内的字段:

SELECT
  (SELECT STRING_AGG(reporteeName, '|')
   FROM UNNEST(reporteeNames)) AS names
FROM `your-project`.dataset.table

另见 working with arrays documentation .

关于javascript - BIGQuery - 函数 ARRAY_TO_STRING 没有匹配的签名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54326470/

相关文章:

google-apps-script - 如何在Google脚本中获取当前文件的名称?

javascript - React js连接数据库

javascript - 水平条形图索引已关闭

mysql - 如果满足条件,则将列总和分配给另一列中某个日期的月份

java - JPA 在工作单元克隆中遇到 Null 或零主键

html - Google 应用程序脚本 : style tags work in index. html 但不是 stylesheet.html

google-apps-script - 修改现有表单值 - GetChoices() 不起作用

javascript - 使用 jQuery 查找作为具有特定类的对象的子对象的第一个祖先

javascript - 如何在 javascript 中显示图像二进制字符串?

sql - TSQL - 如何在 BEGIN .. END block 内使用 GO?