0
我試圖使用類似於this page教程的Java驅動程序將數據流式傳輸到BigQuery,該教程將數據從地圖插入到BigQuery表中。 The v2 of the streaming rest API支持在插入時將行指定爲JSON,所以我想知道是否可以使用Java驅動程序將JSON流式傳輸到bigquery,而不必像下面的示例那樣使用映射。使用Java將JSON流式傳輸到BigQuery
Map<String, Object> rowContent = new HashMap<>();
rowContent.put("booleanField", true);
// Bytes are passed in base64
rowContent.put("bytesField", "Cg0NDg0="); // 0xA, 0xD, 0xD, 0xE, 0xD in base64
// Records are passed as a map
Map<String, Object> recordsContent = new HashMap<>();
recordsContent.put("stringField", "Hello, World!");
rowContent.put("recordField", recordsContent);
InsertAllResponse response = bigquery.insertAll(InsertAllRequest.newBuilder(tableId)
.addRow("rowId", rowContent)
// More rows can be added in the same RPC by invoking .addRow() on the builder
.build());
即有一些方法可以運行bigquery.insertAll
但傳遞一個json字符串而不是一個Map?
有肯定似乎是在C#:https://cloud.google.com/bigquery/streaming-data-into-bigquery#bigquery-stream-data-csharp 我不認爲在Java中,通過快速搜索找不到 –