{"record":{"id":"47e23d2f6c393657","repo":"apache/seatunnel","slug":"sql-search-type-does-not-support-slicing-slice-ma","errorCode":null,"errorMessage":"SQL search_type does not support slicing. slice_max will be ignored.","messagePattern":"SQL search_type does not support slicing\\. slice_max will be ignored\\.","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":176,"sourceCode":"                                sourceType,\n                                null));\n            }\n            catalogTable =\n                    CatalogTable.of(\n                            TableIdentifier.of(\"elasticsearch\", null, index),\n                            builder.build(),\n                            Collections.emptyMap(),\n                            Collections.emptyList(),\n                            \"\");\n        }\n        SearchTypeEnum searchType = readonlyConfig.get(SEARCH_TYPE);\n        SearchApiTypeEnum searchApiType = readonlyConfig.get(SEARCH_API_TYPE);\n        String sqlQuery = readonlyConfig.get(ElasticsearchSourceOptions.SQL_QUERY);\n        String scrollTime = readonlyConfig.get(ElasticsearchSourceOptions.SCROLL_TIME);\n        int scrollSize = readonlyConfig.get(ElasticsearchSourceOptions.SCROLL_SIZE);\n        int sliceMax = readonlyConfig.get(ElasticsearchSourceOptions.SLICE_MAX);\n        if (SearchTypeEnum.SQL.equals(searchType) && sliceMax > 1) {\n            log.warn(\"SQL search_type does not support slicing. slice_max will be ignored.\");\n            sliceMax = 1;\n        }\n\n        long pitKeepAlive = readonlyConfig.get(ElasticsearchSourceOptions.PIT_KEEP_ALIVE);\n        int pitBatchSize = readonlyConfig.get(ElasticsearchSourceOptions.PIT_BATCH_SIZE);\n\n        // Parse runtime fields configuration\n        Map<String, Object> runtimeFields = null;\n        if (readonlyConfig.getOptional(ElasticsearchSourceOptions.RUNTIME_FIELDS).isPresent()) {\n            runtimeFields =\n                    parseRuntimeFields(\n                            readonlyConfig.get(ElasticsearchSourceOptions.RUNTIME_FIELDS));\n        }\n\n        ElasticsearchConfig elasticsearchConfig = new ElasticsearchConfig();\n        elasticsearchConfig.setSource(source);\n        elasticsearchConfig.setCatalogTable(catalogTable);\n        elasticsearchConfig.setQuery(query);","sourceCodeStart":158,"sourceCodeEnd":194,"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#L158-L194","documentation":"Elasticsearch SQL search_type does not support the slice-based parallelism used by scroll/PIT. If search_type=sql and slice_max > 1, the connector logs this warning and resets sliceMax to 1, so the reader will not be parallelized by slicing.","triggerScenarios":"Setting search_type = \"sql\" together with slice_max > 1 in the Elasticsearch source config.","commonSituations":"Users expecting SQL queries to be parallel like scroll/PIT reads; leftover slice_max from a config template.","solutions":["Remove slice_max or set it to 1 when using search_type=sql","Switch search_type to scroll/pit if parallel slicing is needed and the query allows","Accept single-threaded SQL reading"],"exampleFix":"// before\nsearch_type = \"sql\"\nslice_max = 5\n// after\nsearch_type = \"sql\"\n# slice_max removed\n// or for parallelism:\nsearch_type = \"pit\"\nslice_max = 5","handlingStrategy":"validation","validationCode":"// fail fast on incompatible combination\nif (\"sql\".equals(config.getString(\"search_type\")) && config.getInt(\"slice_max\", 1) > 1) {\n    throw new IllegalArgumentException(\"slice_max is not supported with search_type=sql\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only set slice_max for scroll/pit search types","Don't reuse slice_max across search_type variants in templates","Verify expected reader parallelism after switching search_type"],"tags":["elasticsearch","parallelism","config"],"backgroundTag":"unsupported-operation","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"}