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


##########
seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/serialize/source/DefaultSeaTunnelRowDeserializer.java:
##########
@@ -233,7 +233,9 @@ Object convertValue(SeaTunnelDataType<?> fieldType, String 
fieldValue)
     private LocalDateTime parseDate(String fieldValue) {
         // handle strings of timestamp type
         try {
-            long ts = Long.parseLong(fieldValue);
+            // ES timestamps are allowed to be in epoch seconds, we should 
uniformly convert them to
+            // epoch milliseconds
+            long ts = Long.parseLong(fieldValue) * (fieldValue.length() == 10 
? 1000 : 1);

Review Comment:
   why can get date scale by 
https://github.com/apache/seatunnel/blob/875fcd89c59faa4c7b97f3e2c1bf3be707a205cd/seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/catalog/ElasticSearchTypeConverter.java#L134.
 Can we use this information to convert date not use length?



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