0
マップからBigQueryテーブルにデータを挿入するthis pageのチュートリアルのようなJavaドライバを使用してBigQueryにデータをストリーミングしようとしています。 The v2 of the streaming rest APIは、挿入時にJSONとして行を指定することをサポートしていますので、以下の例のようなマップを使用するのではなく、Javaドライバを使用してJSONをbigqueryにストリームできますか?Javaを使用してBigQueryにJSONをストリーミングする
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文字列ではなく、地図に渡すためにいくつかの方法がありますか?
間違いなくC#でがあるようです:https://cloud.google.com/bigquery/streaming-data-into-bigquery#bigquery-stream-data-csharp は、私はJavaではないと思います、クイック検索で見つからなかった –