{"record":{"id":"bc5d1648bf2cce01","repo":"apache/seatunnel","slug":"string-range-split-is-unsafe-for-table-split-c","errorCode":null,"errorMessage":"String range split is unsafe for table {}, split column {}. Requested strategy: {}, fallback strategy: {}, reason: {}","messagePattern":"String range split is unsafe for table (.+?), split column (.+?)\\. Requested strategy: (.+?), fallback strategy: (.+?), reason: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/source/ChunkSplitter.java","lineNumber":225,"sourceCode":"        StringRangeSplitDecision decision =\n                jdbcDialect.validateStringRangeSplit(\n                        getOrEstablishConnection(), table, splitKeyName, 256);\n        if (decision.isSafe()) {\n            return StringSplitStrategy.RANGE;\n        }\n        if (requestedStrategy == StringSplitStrategy.RANGE) {\n            throw new JdbcConnectorException(\n                    CommonErrorCodeDeprecated.ILLEGAL_ARGUMENT,\n                    String.format(\n                            \"String range split is unsafe for table %s, split column %s: %s\",\n                            table.getTablePath(), splitKeyName, decision.getReason()));\n        }\n\n        StringSplitStrategy fallback =\n                jdbcDialect.supportHashSplitter()\n                        ? StringSplitStrategy.HASH\n                        : StringSplitStrategy.NONE;\n        log.warn(\n                \"String range split is unsafe for table {}, split column {}. Requested strategy: {}, fallback strategy: {}, reason: {}\",\n                table.getTablePath(),\n                splitKeyName,\n                requestedStrategy,\n                fallback,\n                decision.getReason());\n        return fallback;\n    }\n\n    protected PreparedStatement createSingleSplitStatement(JdbcSourceSplit split)\n            throws SQLException {\n        String splitQuery = split.getSplitQuery();\n        if (StringUtils.isEmpty(splitQuery)) {\n            splitQuery =\n                    String.format(\n                            \"SELECT * FROM %s\", jdbcDialect.tableIdentifier(split.getTablePath()));\n        }\n        splitQuery = applyUserWhereCondition(splitQuery);","sourceCodeStart":207,"sourceCodeEnd":243,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/source/ChunkSplitter.java#L207-L243","documentation":"ChunkSplitter.resolveStringSplitStrategy() evaluates whether the requested string-split strategy (RANGE) is safe for the table/column based on safety checks (decision). When unsafe it logs this WARN and degrades to a fallback strategy (HASH if the dialect supports it, otherwise NONE = parallelism 1).","triggerScenarios":"split.string-split-strategy = RANGE (or AUTO resolving to RANGE) but safety checks for the split key fail — e.g. column collation makes range comparisons unsafe, unsupported charset, or dialect-specific hazards.","commonSituations":"Tables with case-insensitive or binary collations that break lexicographic ordering; non-UTF8 charsets; columns with mixed-case keys where range splits would mis-partition rows.","solutions":["Accept the HASH fallback (correct, just different partitioning)","Choose a safe numeric or timestamp split column instead","Set split.string-split-strategy to HASH explicitly to silence the warning","Normalize the column's collation/charset to one with stable ordering"],"exampleFix":"// before\nsplit.string-split-strategy = \"RANGE\"\n// after\nsplit.string-split-strategy = \"HASH\"","handlingStrategy":"fallback","validationCode":"// inspect collation before choosing RANGE\nif (!columnCollationIsBinarySafe(table, splitKey)) {\n    config.set(\"split.string-split-strategy\", \"HASH\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer numeric/timestamp split keys","Set HASH explicitly for string keys with risky collations","Review decision reasons in logs during schema analysis"],"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"}