{"record":{"id":"8bf2b0ccb37089b9","repo":"apache/seatunnel","slug":"only-printable-ascii-strings-are-supported-for-str","errorCode":null,"errorMessage":"Only printable ASCII strings are supported for string range split, %s=[%s]","messagePattern":"Only printable ASCII strings are supported for string range split, (.+?)=\\[(.+?)\\]","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/source/AsciiStringRangeSplitter.java","lineNumber":123,"sourceCode":"    private static String bigIntegerToString(BigInteger value, int length) {\n        char[] result = new char[length];\n        BigInteger current = value;\n        BigInteger radix = BigInteger.valueOf(RADIX);\n        for (int i = length - 1; i >= 0; i--) {\n            result[i] = (char) (current.mod(radix).intValue() + FIRST_PRINTABLE_ASCII);\n            current = current.divide(radix);\n        }\n        if (current.compareTo(BigInteger.ZERO) > 0) {\n            throw new IllegalArgumentException(\"Generated string boundary exceeds fixed length\");\n        }\n        return new String(result);\n    }\n\n    private static void validateRangeBoundary(String value, String name) {\n        for (int i = 0; i < value.length(); i++) {\n            char ch = value.charAt(i);\n            if (ch < FIRST_PRINTABLE_ASCII || ch > LAST_PRINTABLE_ASCII) {\n                throw new IllegalArgumentException(\n                        String.format(\n                                \"Only printable ASCII strings are supported for string range split, %s=[%s]\",\n                                name, value));\n            }\n        }\n    }\n\n    private static void validateLexicalOrder(String[] values) {\n        for (int i = 1; i < values.length; i++) {\n            if (values[i - 1].compareTo(values[i]) >= 0) {\n                throw new IllegalArgumentException(\n                        String.format(\n                                \"Generated string range boundary [%s] is not greater than previous boundary [%s]\",\n                                values[i], values[i - 1]));\n            }\n        }\n    }\n}","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/source/AsciiStringRangeSplitter.java#L105-L141","documentation":"validateRangeBoundary enforces that every character of a string range boundary is a printable ASCII character (between FIRST_PRINTABLE_ASCII and LAST_PRINTABLE_ASCII). Non-printable or non-ASCII characters would break the BigInteger-based positional arithmetic over bytes, so the splitter throws IllegalArgumentException identifying the offending boundary and its value.","triggerScenarios":"split() invoked with boundaries containing multi-byte characters (UTF-8 like 'é', CJK), control characters, whitespace below space (0x20), or DEL and above; validateRangeBoundary is called for both left and right boundaries.","commonSituations":"Split key columns containing localized text or emojis; boundaries copied from data with trailing control characters; Unicode data mistakenly chosen as split key.","solutions":["Choose a split key with printable-ASCII-only values, or restrict the range to such values.","Sanitize/strip non-printable characters from boundaries before splitting.","Use a numeric or fixed-length ASCII column as the split key instead.","Fall back to a single (non-split) read for tables with non-ASCII key ranges."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"static boolean isPrintableAscii(String s) {\n  return s.chars().allMatch(c -> c >= 32 && c <= 126);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pick split keys containing only printable ASCII values","Sanitize boundaries (strip control/non-ASCII chars) before splitting","Fall back to single-split reads for non-ASCII key ranges"],"tags":["jdbc","splitter","ascii","validation"],"backgroundTag":"invalid-argument-format","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"}