iemejia commented on code in PR #3731:
URL: https://github.com/apache/parquet-java/pull/3731#discussion_r3940415176
##########
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)
Review Comment:
Good catch — dropped the `ArrayList` cast. `container` is already a
`Collection<?>`, so `toArray(T[])` is available directly. Done in the latest
revision.
##########
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:
Applied your suggestion, thanks! Removed the cast since `container` is a
`Collection<?>`.
--
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]