Carl-Zhou-CN commented on code in PR #7502:
URL: https://github.com/apache/seatunnel/pull/7502#discussion_r1739608170


##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-elasticsearch-e2e/src/test/java/org/apache/seatunnel/e2e/connector/elasticsearch/ElasticsearchIT.java:
##########
@@ -304,17 +331,30 @@ private List<String> generateTestDataSet() throws 
JsonProcessingException {
         return documents;
     }
 
-    private List<String> readSinkDataWithOutSchema() throws 
InterruptedException {
+    private List<String> readSinkDataWithOutSchema(String indexName) throws 
InterruptedException {
         Map<String, BasicTypeDefine<EsType>> esFieldType =
-                esRestClient.getFieldTypeMapping("st_index4", 
Lists.newArrayList());
-        Thread.sleep(2000);
+                esRestClient.getFieldTypeMapping(indexName, 
Lists.newArrayList());
+        Thread.sleep(5000);
         List<String> source = new ArrayList<>(esFieldType.keySet());
-        return getDocsWithTransformDate(source, "st_index4");
+        return getDocsWithTransformDate(source, indexName);
     }
 
-    private List<String> readSinkData(String index) throws 
InterruptedException {
+    // Null values are also a basic use case for testing
+    // To ensure consistency in comparisons, we need to explicitly serialize 
null values.
+    private List<String> readSinkDataWithOutSchema(String indexName, 
List<String> nullAllowedFields)
+            throws InterruptedException {
+        Map<String, BasicTypeDefine<EsType>> esFieldType =
+                esRestClient.getFieldTypeMapping(indexName, 
Lists.newArrayList());
+        Thread.sleep(5000);
+        List<String> source = new ArrayList<>(esFieldType.keySet());
+        return getDocsWithTransformDate(source, indexName, nullAllowedFields);
+    }
+
+    // The timestamp type in Elasticsearch is incompatible with that in 
Seatunnel,
+    // and we need to handle the conversion here.
+    private List<String> readSinkDataWithSchema(String index) throws 
InterruptedException {
         // wait for index refresh
-        Thread.sleep(2000);
+        Thread.sleep(5000);

Review Comment:
   Can we use a parameter here?



-- 
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...@seatunnel.apache.org

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

Reply via email to