【问题标题】:How to select from BigQuery table that is based on nested json?如何从基于嵌套 json 的 BigQuery 表中进行选择?
【发布时间】:2020-06-05 11:55:41
【问题描述】:

我有一个从 json 结构创建的 bigquery 表。我想选择字段protoPayload.authenticationInfo.principalEmail

请帮忙,怎么办?

【问题讨论】:

  • 我没有看到“json”结构。我看到了记录数组。

标签: sql json google-bigquery


【解决方案1】:

我想你只是想要unnest(),两次:

select ai.principalEmail
from t cross join
     unnest(protopayload) ppl cross join
     unnest(authentificationinfo) ai

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-04-29
    • 1970-01-01
    相关资源
    最近更新 更多