-1
我試圖將數據上傳到appengine中的bigquery。如何在從appengine上傳到bigquery時忽略未知值
這裏用我的代碼API從這個streaming sample
@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? 有沒有我可以使用的圖書館?