FuYouJ commented on code in PR #7502:
URL: https://github.com/apache/seatunnel/pull/7502#discussion_r1741487860
##########
seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/source/ElasticsearchSourceFactory.java:
##########
@@ -55,7 +52,7 @@ public String factoryIdentifier() {
@Override
public OptionRule optionRule() {
return OptionRule.builder()
- .required(HOSTS, INDEX)
Review Comment:
Fully compatible with previous configurations, in the ElasticsearchSource
code, the first if step is to check for the existence of index_ist. If it
exists, it should be parsed synchronously as multiple tables, and if it does
not exist, it should be parsed synchronously as a single table
```
public ElasticsearchSource(ReadonlyConfig config) {
this.connectionConfig = config;
boolean multiSource =
config.getOptional(SourceConfig.INDEX_LIST).isPresent();
boolean singleSource =
config.getOptional(SourceConfig.INDEX).isPresent();
if (multiSource && singleSource) {
log.warn(
"Elasticsearch Source config warn: when both 'index' and
'index_list' are present in the configuration, only the 'index_list'
configuration will take effect");
}
if (!multiSource && !singleSource) {
throw new ElasticsearchConnectorException(
ElasticsearchConnectorErrorCode.SOURCE_CONFIG_ERROR_01,
ElasticsearchConnectorErrorCode.SOURCE_CONFIG_ERROR_01.getDescription());
}
if (multiSource) {
this.sourceConfigList = createMultiSource(config);
} else {
this.sourceConfigList =
Collections.singletonList(parseOneIndexQueryConfig(config));
}
}
```
--
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]