Fokko commented on code in PR #3731:
URL: https://github.com/apache/parquet-java/pull/3731#discussion_r3923406141


##########
parquet-avro/src/main/java/org/apache/parquet/avro/AvroRecordConverter.java:
##########
@@ -787,7 +787,8 @@ public void end() {
       } else if (elementClass == double.class) {
         parent.add(((DoubleArrayList) container).toDoubleArray());
       } else {
-        parent.add(((ArrayList) container).toArray());
+        parent.add(((ArrayList) container)
+            .toArray((Object[]) 
java.lang.reflect.Array.newInstance(elementClass, 0)));

Review Comment:
   I agree with @RyanSkraba's suggestion, tested locally, and the cast is not 
needed:
   
   ```suggestion
           parent.add(container.toArray((Object[]) 
java.lang.reflect.Array.newInstance(elementClass, 0)));
   ```



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to