apache/seatunnel · warning
The schema config in ElasticSearch source/sink is…
Error message
The schema config in ElasticSearch source/sink is deprecated, please use source config instead!
What it means
The connector 'schema' option in the Elasticsearch source config is deprecated. If readonlyConfig contains ConnectorCommonOptions.SCHEMA, this warning is logged and the deprecated CatalogTableUtil.buildWithConfig path is used to derive the source fields.
Solutions
- Replace the schema block with the 'source' option listing field names
- Remove the schema block entirely to infer fields from index mappings
- Review deprecated option docs for the equivalent new syntax
Example fix
// before
schema = {
fields { name = string, age = int }
}
// after
source = ["name", "age"] Defensive patterns
Strategy: validation
Validate before calling
// detect deprecated schema usage
if (config.hasPath("schema")) {
LOG.warn("'schema' is deprecated for ES source; use 'source'");
} Prevention
- Migrate configs to the 'source' option
- Track SeaTunnel release notes for deprecated options
- Prefer inferring fields from index mappings when possible
When it happens
Trigger: Configuring the Elasticsearch source with a 'schema { fields { ... } }' block instead of the native 'source' option.
Common situations: Migrating older job configs forward; examples or docs from older SeaTunnel versions still using schema blocks.
Understand the failure class
Background: "is deprecated and will be removed" — deprecation warnings for old API names, keywords, and options, and how to migrate before the removal release — this error's family across 29 libraries.
Related errors
- Elasticsearch Source config warn: when both 'index' and…
- input.queue is no longer supported; configure top-level…
- Invalid runtime field configuration
- SQL search_type does not support slicing. slice_max will be…
- SQL search_type does not support slicing. slice_max will be…
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/e9e9c197a3353595.
Report an issue: GitHub.
Appendix: source
Thrown at seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/source/ElasticsearchSource.java:118
ElasticsearchConfig elasticsearchConfig = parseOneIndexQueryConfig(readonlyConfig);
elasticsearchConfigList.add(elasticsearchConfig);
}
return elasticsearchConfigList;
}
private ElasticsearchConfig parseOneIndexQueryConfig(ReadonlyConfig readonlyConfig) {
Map<String, Object> query = readonlyConfig.get(ElasticsearchSourceOptions.QUERY);
String index = readonlyConfig.get(ElasticsearchSourceOptions.INDEX);
CatalogTable catalogTable;
List<String> source;
Map<String, String> arrayColumn;
if (readonlyConfig.getOptional(ConnectorCommonOptions.SCHEMA).isPresent()) {
// todo: We need to remove the schema in ES.
log.warn(
"The schema config in ElasticSearch source/sink is deprecated, please use source config instead!");
catalogTable = CatalogTableUtil.buildWithConfig(readonlyConfig);
source = Arrays.asList(catalogTable.getSeaTunnelRowType().getFieldNames());
} else {
source = readonlyConfig.get(ElasticsearchSourceOptions.SOURCE);
arrayColumn = readonlyConfig.get(ElasticsearchSourceOptions.ARRAY_COLUMN);
Map<String, BasicTypeDefine<EsType>> esFieldType;
if (SearchTypeEnum.SQL.equals(readonlyConfig.get(SEARCH_TYPE))) {
esFieldType = getSqlFieldTypeMapping(readonlyConfig.get(SQL_QUERY), source);
} else {
esFieldType = getFieldTypeMapping(index, source);
}
if (CollectionUtils.isEmpty(source)) {
source = new ArrayList<>(esFieldType.keySet());
}
SeaTunnelDataType[] fieldTypes = getSeaTunnelDataType(esFieldType, source);
TableSchema.Builder builder = TableSchema.builder();
View on GitHub (pinned to cf67b549a7)