【问题标题】:BigQuery's support of JSON array for importBigQuery 对 JSON 数组导入的支持
【发布时间】:2013-03-24 07:03:51
【问题描述】:

我有一个存储在 JSON 中的项目列表。目前,BigQuery 似乎不支持 JSON 数组。我有以下 JSON:

[
    {
        "purchaseId": "f7c67e39-5382-4d08-a308-0e4657143c44",
        "platform": "googleplay",
        "createdAt": 1364226047214,
        "type": "currency",
        "purchaseDate": 1364225968000,
        "updatedAt": 1364226052634
    },
    {
        "purchaseId": "f7c67e39-5382-4d08-a308-0e4657143c44",
        "platform": "googleplay",
        "createdAt": 1364226047214,
        "type": "currency",
        "purchaseDate": 1364225968000,
        "updatedAt": 1364226052634
    },
    {
        "purchaseId": "f7c67e39-5382-4d08-a308-0e4657143c44",
        "platform": "googleplay",
        "createdAt": 1364226047214,
        "type": "currency",
        "purchaseDate": 1364225968000,
        "updatedAt": 1364226052634
    }
]

我收到以下错误:

    Line:1 / Column:1, Expected '{' found '['

以下内容将是无效的 JSON:

    {
        "purchaseId": "f7c67e39-5382-4d08-a308-0e4657143c44",
        "platform": "googleplay",
        "createdAt": 1364226047214,
        "type": "currency",
        "purchaseDate": 1364225968000,
        "updatedAt": 1364226052634
    },
    {
        "purchaseId": "f7c67e39-5382-4d08-a308-0e4657143c44",
        "platform": "googleplay",
        "createdAt": 1364226047214,
        "type": "currency",
        "purchaseDate": 1364225968000,
        "updatedAt": 1364226052634
    }

那么,对 JSON 中的项目进行分组以便 BigQuery 轻松使用的最佳方式是什么?

【问题讨论】:

    标签: json google-app-engine google-bigquery google-cloud-storage


    【解决方案1】:

    我相信输入在技术上是无效的 JSON。它被称为“换行符分隔的 JSON”。每行必须是一个独立的 JSON 字典,末尾有一个换行符。行间没有逗号。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-11-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-24
      • 1970-01-01
      • 2019-06-03
      • 1970-01-01
      相关资源
      最近更新 更多