{"record":{"id":"8d954462aac79230","repo":"apache/seatunnel","slug":"range-string-split-failed-for-table-fallback-t","errorCode":null,"errorMessage":"Range string split failed for table {}, fallback to hash split","messagePattern":"Range string split failed for table (.+?), fallback to hash split","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/source/DynamicChunkSplitter.java","lineNumber":153,"sourceCode":"            throws Exception {\n        StringSplitStrategy strategy = resolveStringSplitStrategy(table, splitKeyName);\n        switch (strategy) {\n            case NONE:\n                return Collections.singletonList(\n                        createSingleStringSplit(table, splitKeyName, splitKeyType));\n            case HASH:\n                if (jdbcDialect.supportHashSplitter()) {\n                    return createStringColumnSplits(\n                            table, splitKeyName, splitKeyType, config.getSplitSize());\n                }\n                return Collections.singletonList(\n                        createSingleStringSplit(table, splitKeyName, splitKeyType));\n            case RANGE:\n                if (config.getStringSplitStrategy() == StringSplitStrategy.AUTO) {\n                    try {\n                        return createStringRangeSplits(table, splitKeyName, splitKeyType);\n                    } catch (Exception e) {\n                        log.warn(\n                                \"Range string split failed for table {}, fallback to hash split\",\n                                table.getTablePath(),\n                                e);\n                        if (jdbcDialect.supportHashSplitter()) {\n                            return createStringColumnSplits(\n                                    table, splitKeyName, splitKeyType, config.getSplitSize());\n                        }\n                        return Collections.singletonList(\n                                createSingleStringSplit(table, splitKeyName, splitKeyType));\n                    }\n                }\n                return createStringRangeSplits(table, splitKeyName, splitKeyType);\n            default:\n                throw new JdbcConnectorException(\n                        CommonErrorCodeDeprecated.ILLEGAL_ARGUMENT,\n                        \"Unsupported string split strategy: \" + config.getStringSplitStrategy());\n        }\n    }","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/source/DynamicChunkSplitter.java#L135-L171","documentation":"DynamicChunkSplitter.createStringStrategySplits() tries createStringRangeSplits() when the string split strategy is AUTO with RANGE chosen; any exception triggers this WARN and a fallback to hash-based string splits (if the dialect supports it), otherwise a single split.","triggerScenarios":"RANGE string splitting throws at runtime — e.g. unparseable/odd string values breaking min/max computation, comparator issues with the column type, or collation-induced comparison failures.","commonSituations":"String keys containing mixed encodings or null-like edge values; dialects whose string comparison is not binary-safe; very skewed string distributions causing split computation failures.","solutions":["Let the fallback happen (hash splits are correct)","Set split.string-split-strategy = HASH directly to avoid the failed attempt","Pick a numeric/timestamp split_key for predictable range splits"],"exampleFix":"// before\nsplit.string-split-strategy = \"AUTO\"\n// after\nsplit.string-split-strategy = \"HASH\"","handlingStrategy":"fallback","validationCode":"// sample values and pre-validate range comparability\nboolean safe = sampleColumn(table, splitKey).stream()\n    .allMatch(v -> v != null && isComparableString(v));\nif (!safe) config.set(\"split.string-split-strategy\", \"HASH\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use HASH for string keys with mixed encodings","Clean/normalize string key values","Monitor the WARN and rely on the hash fallback's correctness"],"tags":["jdbc","split","fallback"],"backgroundTag":"fallback-strategy-applied","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"}