ahmedabu98 commented on code in PR #26873:
URL: https://github.com/apache/beam/pull/26873#discussion_r1204630625
##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryUtils.java:
##########
@@ -694,7 +694,7 @@ public static Row toBeamRow(Schema rowSchema, TableSchema
bqSchema, TableRow jso
if (jsonBQValue instanceof List) {
return ((List<Object>) jsonBQValue)
.stream()
- .map(v -> ((Map<String, Object>) v).get("v"))
+ .map(v -> v instanceof Map ? ((Map<String, Object>) v).get("v")
: v)
Review Comment:
Let's also check that the fieldType.getCollectionElementType() isn't a Map.
ie. we should also skip the `get("v")"` operation if the user is converting
a TableRow value to a List<Maps<X, Y>>.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]