【发布时间】:2019-10-20 22:50:16
【问题描述】:
目前,我的表的一个属性中有一组对象
table metadata{
String id,
repeated Point points
}
table Point{
String x,
String y
}
当我这样做时
select id, points from metadata
在 Google BigQuery 中
我得到格式的数据
[
{
"id": "453ee599-0e74-4098-bda5-9808953cf757",
"points": [
{
"x": "x_",
"y": "y1_"
},
{
"x": "x2_",
"y": "y2_",
}
]
}
]
我应该如何修改我的 sql 查询以使结果符合格式
[
{
"id": "453ee599-0e74-4098-bda5-9808953cf757",
"x" : "x1_",
"y" : "y1_",
},
{
"id": "453ee599-0e74-4098-bda5-9808953cf757",
"x" : "x2_",
"y" : "y2_",
}
]
【问题讨论】:
-
我阅读了您的帖子,但无法理解您的数据结构。你能提供一个 dbfiddle 的例子吗?
-
@user3285099 - 考虑对有帮助的答案进行投票,并接受您认为最有帮助的答案!
标签: mysql sql google-bigquery