stankiewicz commented on code in PR #34102:
URL: https://github.com/apache/beam/pull/34102#discussion_r1979934652
##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/TableRowToStorageApiProto.java:
##########
@@ -539,16 +539,14 @@ public static DynamicMessage messageFromMap(
if
(fieldSchemaInformation.getType().equals(TableFieldSchema.Type.STRUCT)
&& unknownFields != null) {
- if (unknownFields.get(key) instanceof Map
- && ((Map<?, ?>) unknownFields.get(key)).isEmpty()) {
+ if ((unknownFields.get(key) instanceof Map
+ && ((Map<?, ?>) unknownFields.get(key)).isEmpty()) // single
struct, empty
+ || (unknownFields.get(key)
+ instanceof List // repeated struct, empty list or list
with empty structs
+ && (((List<?>) unknownFields.get(key)).isEmpty()
+ || ((List<?>) unknownFields.get(key))
+ .stream().allMatch(row -> row == null || ((Map<?,
?>) row).isEmpty())))) {
Review Comment:
Done and green
--
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]