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

  1. Replace the schema block with the 'source' option listing field names
  2. Remove the schema block entirely to infer fields from index mappings
  3. 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

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


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)