You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/08/17 15:30:06 UTC

[GitHub] [beam] rworley-monster commented on a change in pull request #12389: [BEAM-10587] Support Maps in BigQuery

rworley-monster commented on a change in pull request #12389:
URL: https://github.com/apache/beam/pull/12389#discussion_r471559168



##########
File path: sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryUtils.java
##########
@@ -443,6 +467,17 @@ public static TableRow toTableRow(Row row) {
         }
         return convertedItems;
 
+      case MAP:
+        Map<?, ?> pairs = (Map<?, ?>) fieldValue;
+        convertedItems = Lists.newArrayListWithCapacity(pairs.size());
+        for (Map.Entry<?, ?> pair : pairs.entrySet()) {
+          convertedItems.add(
+              new TableRow()
+                  .set(BIGQUERY_MAP_KEY_FIELD_NAME, pair.getKey())

Review comment:
       Nice catch.  I've updated it with that and tried to copy the above ITERABLE conversion as closely as possible.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org