ahmedabu98 commented on code in PR #39750:
URL: https://github.com/apache/beam/pull/39750#discussion_r3787458724


##########
sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/SchemaUtils.java:
##########
@@ -279,7 +284,7 @@ static String toPrettyFieldValueString(Schema.FieldType 
fieldType, Object value,
           FieldType elementType = 
Objects.requireNonNull(fieldType.getCollectionElementType());
 
           @SuppressWarnings("unchecked")
-          List<Object> list = (List<Object>) value;
+          List<Object> list = Lists.newArrayList((Iterable<Object>) value);

Review Comment:
   nit: keep the original iterable instead of recreating the object as a list? 
use guava `Iterables.isEmpty` and `Iterables.size` for the lines below



-- 
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]

Reply via email to