Hisoka-X commented on code in PR #6425:
URL: https://github.com/apache/seatunnel/pull/6425#discussion_r1560590558
##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-elasticsearch-e2e/src/test/java/org/apache/seatunnel/e2e/connector/elasticsearch/ElasticsearchIT.java:
##########
@@ -179,6 +181,17 @@ public void testElasticsearchWithFullType(TestContainer
container)
esRestClient.getIndexDocsCount("st_index_full_type_target").get(0).getDocsCount());
}
+ @TestTemplate
+ public void testElasticsearchWithoutSchema(TestContainer container)
+ throws IOException, InterruptedException {
+ Container.ExecResult execResult =
+
container.executeJob("/elasticsearch/elasticsearch_source_and_sink.conf");
Review Comment:
```suggestion
container.executeJob("/elasticsearch/elasticsearch_source_without_schema_and_sink.conf");
```
##########
seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/source/ElasticsearchSource.java:
##########
@@ -127,4 +133,28 @@ public SourceReader<SeaTunnelRow,
ElasticsearchSourceSplit> createReader(
return new ElasticsearchSourceSplitEnumerator(
enumeratorContext, sourceState, config, source);
}
+
+ public static SeaTunnelDataType[] getSeaTunnelDataType(
Review Comment:
```suggestion
@VisibleForTesting
public static SeaTunnelDataType[] getSeaTunnelDataType(
```
##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-elasticsearch-e2e/src/test/java/org/apache/seatunnel/e2e/connector/elasticsearch/ElasticsearchIT.java:
##########
@@ -179,6 +181,17 @@ public void testElasticsearchWithFullType(TestContainer
container)
esRestClient.getIndexDocsCount("st_index_full_type_target").get(0).getDocsCount());
}
+ @TestTemplate
+ public void testElasticsearchWithoutSchema(TestContainer container)
+ throws IOException, InterruptedException {
+ Container.ExecResult execResult =
+
container.executeJob("/elasticsearch/elasticsearch_source_and_sink.conf");
+ Assertions.assertEquals(0, execResult.getExitCode());
+ List<String> sinkData = readSinkDataWithOutSchema();
+ // for DSL is: {"range":{"c_int":{"gte":10,"lte":20}}}
+ Assertions.assertIterableEquals(mapTestDatasetForDSL(), sinkData);
Review Comment:
I mean this test case and
https://github.com/apache/seatunnel/pull/6425/files#diff-4ae713cc819c2f12617dfe46ece4360566083e9a54519fce3c470b235766d020R162
both use `st_index2` as index which write data into. Therefore, we need to
clear the data in `st_index2` before executing the test case, so as to prove
that the data was written by the current use case.
--
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]