【问题标题】:Updating an array field columns in big query [duplicate]在大查询中更新数组字段列[重复]
【发布时间】:2020-05-26 17:52:34
【问题描述】:

问题陈述:

如何在大查询中更新数组字段

下面是我的桌子

Test_table
-------------------------------
file.fileName | file.count
-------------------------------
abc.txt.      | 100
-------------------------------

从上表中我需要更新文件名和计数字段

架构:

{

  "name": "file"
  "type" : "record"
  "mode" : "repeated"
  "fields" :[
            {
               "name": fileName
               "type": string
               "mode" :nullable
             },
             {
               "name": count
               "type": string
               "mode" :nullable
             }
             ]  
}

有人可以帮我了解如何在此表上执行更新查询

【问题讨论】:

    标签: sql google-bigquery


    【解决方案1】:

    你不能这样做吗?

    update t
        set file[safe_offset(1)].filename = ?,
            file[safe_offset(1)].count = ?
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-04-18
      • 1970-01-01
      • 2016-04-08
      • 2019-03-08
      • 2019-09-22
      • 2015-07-10
      • 1970-01-01
      相关资源
      最近更新 更多