apache/seatunnel · warning
SQL search_type does not support slicing. slice_max will be…
Error message
SQL search_type does not support slicing. slice_max will be ignored.
What it means
A WARN from ElasticsearchSourceSplitEnumerator.getElasticsearchSplit: the job is configured with search_type=SQL but also sets slice_max > 1. SQL-based reads cannot be sliced, so the enumerator forces sliceMax to 1 and ignores the configured parallelism hint, producing a single split per index.
Solutions
- Remove slice_max (or set it to 1) since SQL reads cannot be sliced
- Switch search_type to DSL (or the slicing-capable type) if you need multi-slice parallel reading
- Verify effective parallelism after the change — with this warn, each index yields exactly one split
Example fix
// before search_type = SQL slice_max = 5 // after search_type = DSL slice_max = 5 // (or keep SQL and delete slice_max)
Defensive patterns
Strategy: validation
Validate before calling
// validate config before submit (pseudo-check)
if (config.search_type == "SQL" && (config.slice_max ?? 1) > 1) {
console.log("slice_max ignored with search_type=SQL; switch to DSL for slicing");
} Prevention
- Never combine search_type=SQL with slice_max > 1
- Use search_type=DSL when index-size-based slicing/parallelism is needed
- Confirm actual split count in job logs after changing search types
When it happens
Trigger: Configuring an Elasticsearch source with search_type = SQL and slice_max greater than 1; the enumerator builds splits (via newSplits) and detects the combination.
Common situations: Copy-pasting config between DSL/JSON jobs that used search_type=DSL (which supports slicing) and switching to SQL without removing slice_max; users expecting parallel SQL reads for large indices.
Understand the failure class
Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.
Related errors
- SQL search_type does not support slicing. slice_max will be…
- Elasticsearch Source config warn: when both 'index' and…
- ILLEGAL_CONFIG_ARGUMENT
- Invalid runtime field configuration
- The schema config in ElasticSearch source/sink is…
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/be50dede8c21dbba.
Report an issue: GitHub.
Appendix: source
Thrown at seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/source/ElasticsearchSourceSplitEnumerator.java:166
}
}
}
}
private List<ElasticsearchSourceSplit> getElasticsearchSplit() {
List<ElasticsearchSourceSplit> splits = new ArrayList<>();
for (ElasticsearchConfig elasticsearchConfig : elasticsearchConfigs) {
String index = elasticsearchConfig.getIndex();
List<IndexDocsCount> indexDocsCounts = esRestClient.getIndexDocsCount(index);
indexDocsCounts =
indexDocsCounts.stream()
.filter(x -> x.getDocsCount() != null && x.getDocsCount() > 0)
.sorted(Comparator.comparingLong(IndexDocsCount::getDocsCount))
.collect(Collectors.toList());
int sliceMax = Math.max(1, elasticsearchConfig.getSliceMax());
if (SearchTypeEnum.SQL.equals(elasticsearchConfig.getSearchType()) && sliceMax > 1) {
log.warn("SQL search_type does not support slicing. slice_max will be ignored.");
sliceMax = 1;
}
for (IndexDocsCount indexDocsCount : indexDocsCounts) {
String indexName = indexDocsCount.getIndex();
for (int sliceId = 0; sliceId < sliceMax; sliceId++) {
ElasticsearchConfig cloneCfg = elasticsearchConfig.clone();
cloneCfg.setIndex(indexName);
cloneCfg.setSliceId(sliceId);
cloneCfg.setSliceMax(sliceMax);
String splitId = sliceMax > 1 ? indexName + "#" + sliceId : indexName;
splits.add(new ElasticsearchSourceSplit(splitId, cloneCfg));
}
}
}
return splits;
}
@OverrideView on GitHub (pinned to cf67b549a7)