【问题标题】:Delay in seeing data from InsertAll从 InsertAll 中查看数据的延迟
【发布时间】:2016-10-07 22:54:42
【问题描述】:

这是我用来向 bigquery 发送 1 行数据的代码。

假设如下:

  1. 表架构很好(当我在 ui 中创建具有相同架构和相同 1 行数据的表时有效)
  2. 包含键值对的映射很好
  3. 凭证很好
  4. ProjectId、datasetId 和 tableId 是否正确(在创建 url 时通过逐步检查所有内容)

它总是返回没有错误的响应和以下输出: {"kind":"bigquery#tableDataInsertAllResponse"} // 确认状态:200

我的行的结构可能不正确,但我花了很多时间将其分开。据我了解

  1. 列表(TableDataInsertAllRequest.Rows 对象)

  2. TableDataInsertAllRequest.Rows 对象包含一个键“json”,其值为 ->

  3. 地图(包含所需的 JSON 值)

    List<TableDataInsertAllRequest.Rows> rowsList = new ArrayList<>();
    TableDataInsertAllRequest.Rows oneRow = new TableDataInsertAllRequest.Rows();
    try {
        Map<String, Object> objectMap = new TreeMap<>();
        oneRow.setJson(objectMap);
    } catch (Exception e){
        e.printStackTrace();
    }
    rowsList.add(oneRow);
    
    TableDataInsertAllRequest content = new TableDataInsertAllRequest();
        content.setKind("bigquery#tableDataInsertAllRequest");
        content.setRows(rowsList);
    
    Bigquery.Tabledata.InsertAll request =
                bigqueryService.tabledata().insertAll(projectId, datasetId, tableId, content);
    TableDataInsertAllResponse response = request.execute();
    

有什么想法吗?

【问题讨论】:

标签: google-bigquery


【解决方案1】:

找到了解决方案,显然我在文档中错过了它。

https://cloud.google.com/bigquery/streaming-data-into-bigquery

“数据最多可能需要 90 分钟才能用于复制和导出操作...”

附:对于遇到此问题的任何人,要查看数据是否实际上已上传查询表,应该在流式传输后几乎立即将数据包含在其中。

** 一定要知道流媒体限制,否则你会得到一个随机的 400 错误。必须为每个请求分块我的数据。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-09-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-04
    • 2013-09-04
    • 1970-01-01
    相关资源
    最近更新 更多