[ 
https://issues.apache.org/jira/browse/BEAM-10587?focusedWorklogId=470758&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-470758
 ]

ASF GitHub Bot logged work on BEAM-10587:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 14/Aug/20 16:58
            Start Date: 14/Aug/20 16:58
    Worklog Time Spent: 10m 
      Work Description: apilloud commented on a change in pull request #12389:
URL: https://github.com/apache/beam/pull/12389#discussion_r470743118



##########
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:
       You'll need to convert the types stored in the map as well. Something 
like `fromBeamField(fieldType.getMapKeyType(), pair.getKey())`




----------------------------------------------------------------
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:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 470758)
    Time Spent: 1h 50m  (was: 1h 40m)

> Support Maps in BigQuery
> ------------------------
>
>                 Key: BEAM-10587
>                 URL: https://issues.apache.org/jira/browse/BEAM-10587
>             Project: Beam
>          Issue Type: Improvement
>          Components: io-java-gcp
>            Reporter: Ryan Worley
>            Assignee: Ryan Worley
>            Priority: P2
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> Maps are currently not supported when converting a Beam Schema to a BigQuery 
> TableFieldSchema.  This improvement will convert Maps to repeated records 
> with 'key' and 'value' fields.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to