KurtYoung commented on a change in pull request #10107: [FLINK-14608] 
[flink-json] Avoid using Java Streams in JsonRowDeserializationSchema
URL: https://github.com/apache/flink/pull/10107#discussion_r343464200
 
 

 ##########
 File path: 
flink-formats/flink-json/src/main/java/org/apache/flink/formats/json/JsonRowDeserializationSchema.java
 ##########
 @@ -429,13 +428,21 @@ private Object convertField(
                }
        }
 
-       private DeserializationRuntimeConverter 
assembleArrayConverter(DeserializationRuntimeConverter elementConverter) {
+       private DeserializationRuntimeConverter assembleArrayConverter(
+               TypeInformation<?> elementType,
+               DeserializationRuntimeConverter elementConverter) {
+
+               final Class<?> elementClass = elementType.getTypeClass();
+
                return (mapper, jsonNode) -> {
-                       ArrayNode node = (ArrayNode) jsonNode;
+                       final ArrayNode node = (ArrayNode) jsonNode;
+                       final Object[] array = (Object[]) 
Array.newInstance(elementClass, node.size());
 
 Review comment:
   Just new a normal `Object[]` is enough?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to