我试图将数据上传到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? 我可以使用任何图书馆吗?
答案 0 :(得分:1)
请参阅
TableDataInsertAllRequest.setIgnoreUnknownValues()