{"record":{"id":"e9e9c197a3353595","repo":"apache/seatunnel","slug":"the-schema-config-in-elasticsearch-source-sink-is","errorCode":null,"errorMessage":"The schema config in ElasticSearch source/sink is deprecated, please use source config instead!","messagePattern":"The schema config in ElasticSearch source/sink is deprecated, please use source config instead!","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/source/ElasticsearchSource.java","lineNumber":118,"sourceCode":"            ElasticsearchConfig elasticsearchConfig = parseOneIndexQueryConfig(readonlyConfig);\n            elasticsearchConfigList.add(elasticsearchConfig);\n        }\n        return elasticsearchConfigList;\n    }\n\n    private ElasticsearchConfig parseOneIndexQueryConfig(ReadonlyConfig readonlyConfig) {\n\n        Map<String, Object> query = readonlyConfig.get(ElasticsearchSourceOptions.QUERY);\n        String index = readonlyConfig.get(ElasticsearchSourceOptions.INDEX);\n\n        CatalogTable catalogTable;\n        List<String> source;\n        Map<String, String> arrayColumn;\n\n        if (readonlyConfig.getOptional(ConnectorCommonOptions.SCHEMA).isPresent()) {\n            // todo: We need to remove the schema in ES.\n            log.warn(\n                    \"The schema config in ElasticSearch source/sink is deprecated, please use source config instead!\");\n            catalogTable = CatalogTableUtil.buildWithConfig(readonlyConfig);\n            source = Arrays.asList(catalogTable.getSeaTunnelRowType().getFieldNames());\n        } else {\n            source = readonlyConfig.get(ElasticsearchSourceOptions.SOURCE);\n            arrayColumn = readonlyConfig.get(ElasticsearchSourceOptions.ARRAY_COLUMN);\n            Map<String, BasicTypeDefine<EsType>> esFieldType;\n            if (SearchTypeEnum.SQL.equals(readonlyConfig.get(SEARCH_TYPE))) {\n                esFieldType = getSqlFieldTypeMapping(readonlyConfig.get(SQL_QUERY), source);\n            } else {\n                esFieldType = getFieldTypeMapping(index, source);\n            }\n\n            if (CollectionUtils.isEmpty(source)) {\n                source = new ArrayList<>(esFieldType.keySet());\n            }\n            SeaTunnelDataType[] fieldTypes = getSeaTunnelDataType(esFieldType, source);\n            TableSchema.Builder builder = TableSchema.builder();\n","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/source/ElasticsearchSource.java#L100-L136","documentation":"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.","triggerScenarios":"Configuring the Elasticsearch source with a 'schema { fields { ... } }' block instead of the native 'source' option.","commonSituations":"Migrating older job configs forward; examples or docs from older SeaTunnel versions still using schema blocks.","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"],"exampleFix":"// before\nschema = {\n  fields { name = string, age = int }\n}\n// after\nsource = [\"name\", \"age\"]","handlingStrategy":"validation","validationCode":"// detect deprecated schema usage\nif (config.hasPath(\"schema\")) {\n    LOG.warn(\"'schema' is deprecated for ES source; use 'source'\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Migrate configs to the 'source' option","Track SeaTunnel release notes for deprecated options","Prefer inferring fields from index mappings when possible"],"tags":["elasticsearch","deprecated","config"],"backgroundTag":"deprecated-api-usage","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}