【问题标题】:How to ignore unknown values when uploading to bigquery from appengine从 appengine 上传到 bigquery 时如何忽略未知值
【发布时间】:2016-12-01 16:09:13
【问题描述】:

我正在尝试将数据上传到 appengine 中的 bigquery。

这是我使用来自streaming sample的api的代码

@Override
    public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {

    String projectId = "myprojectId";
    String datasetId = "mydatasetId";
    String tableId = "person";
    System.out.println("Enter JSON to stream to BigQuery: \n" + "Press End-of-stream (CTRL-D) to stop");

    String string = "[\n  {\"Name\": \"test\", \"Age\": 0, \"Weight\": 100.0, \"IsMagic\": false},\n  {\"Name\": \"test\", \"Age\": 1, \"Weight\": 100.0, \"IsMagic\": false},\n  {\"Name\": \"test\", \"Age\": 2, \"Weight\": 100.0, \"IsMagic\": false},\n  {\"Name\": \"test\", \"Age\": 3, \"Weight\": 100.0, \"IsMagic\": false},\n  {\"Name\": \"test\", \"Age\": 0, \"Weight\": 100.0, \"IsMagic\": false}\n]";
    JsonReader jsonReader = new JsonReader(new StringReader(string));

    Iterator<TableDataInsertAllResponse> responses = StreamingSample.run(projectId, datasetId, tableId, jsonReader);

    while (responses.hasNext()) {
        log.info(responses.next());
    }

    jsonReader.close();


}

现在我如何进行大查询ignoreUnknownValues? 有没有我可以使用的库?

【问题讨论】:

    标签: java google-app-engine google-bigquery


    【解决方案1】:
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-16
    • 1970-01-01
    • 1970-01-01
    • 2022-07-25
    • 2011-02-26
    • 1970-01-01
    相关资源
    最近更新 更多