Hisoka-X commented on code in PR #6120:
URL: https://github.com/apache/seatunnel/pull/6120#discussion_r1451161598


##########
seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/serialize/ElasticsearchRowSerializer.java:
##########
@@ -171,7 +171,20 @@ private Map<String, Object> toDocumentMap(SeaTunnelRow 
row) {
                 // jackson not support jdk8 new time api
                 doc.put(fieldNames[i], value.toString());
             } else {
-                doc.put(fieldNames[i], value);
+                if (value != null) {
+                    if (value instanceof String) {
+                        Object o = convertToObjectOrArray(value.toString());
+                        if (o != null) {
+                            doc.put(fieldNames[i], o);
+                        } else {
+                            doc.put(fieldNames[i], value);
+                        }
+                    } else {
+                        doc.put(fieldNames[i], value);
+                    }
+                } else {
+                    doc.put(fieldNames[i], value);
+                }

Review Comment:
   ```suggestion
                   if (value != null && value instanceof String) {
                       Object o = convertToObjectOrArray(value.toString());
                       if (o != null) {
                           doc.put(fieldNames[i], o);
                       } else {
                           doc.put(fieldNames[i], value);
                       }
                   } else {
                       doc.put(fieldNames[i], value);
                   }
   ```



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