JNSimba commented on code in PR #91:
URL: 
https://github.com/apache/doris-spark-connector/pull/91#discussion_r1159221392


##########
spark-doris-connector/src/main/java/org/apache/doris/spark/util/ListUtils.java:
##########
@@ -43,10 +43,11 @@ public static List<String> 
getSerializedList(List<Map<Object, Object>> batch) th
      * @throws JsonProcessingException
      */
     public static void divideAndSerialize(List<Map<Object, Object>> batch, 
List<String> result) throws JsonProcessingException {
-        String serializedResult = (new 
ObjectMapper()).writeValueAsString(batch);
+
         // if an error occurred in the batch call to getBytes ,average divide 
the batch
         try {
             //the "Requested array size exceeds VM limit" exception occurs 
when the collection is large
+            String serializedResult = (new 
ObjectMapper()).writeValueAsString(batch);

Review Comment:
   Would it be better to create `new ObjectMapper()` only once?



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to