{"record":{"id":"148dce16e415bf31","repo":"apache/seatunnel","slug":"illegal-argument-148dce","errorCode":"ILLEGAL_ARGUMENT","errorMessage":"Failed to parse delimiter: `Hex str is empty`","messagePattern":"Failed to parse delimiter: `Hex str is empty`","errorType":"error_code","errorClass":"StarRocksConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/serialize/StarRocksDelimiterParser.java","lineNumber":42,"sourceCode":"\nimport java.io.StringWriter;\n\npublic class StarRocksDelimiterParser {\n    private static final int SHIFT = 4;\n\n    private static final String HEX_STRING = \"0123456789ABCDEF\";\n\n    public static String parse(String sp, String dSp) throws RuntimeException {\n        if (Strings.isNullOrEmpty(sp)) {\n            return dSp;\n        }\n        if (!sp.toUpperCase().startsWith(\"\\\\X\")) {\n            return sp;\n        }\n        String hexStr = sp.substring(2);\n        // check hex str\n        if (hexStr.isEmpty()) {\n            throw new StarRocksConnectorException(\n                    CommonErrorCodeDeprecated.ILLEGAL_ARGUMENT,\n                    \"Failed to parse delimiter: `Hex str is empty`\");\n        }\n        if (hexStr.length() % 2 != 0) {\n            throw new StarRocksConnectorException(\n                    CommonErrorCodeDeprecated.ILLEGAL_ARGUMENT,\n                    \"Failed to parse delimiter: `Hex str is empty`\");\n        }\n        for (char hexChar : hexStr.toUpperCase().toCharArray()) {\n            if (HEX_STRING.indexOf(hexChar) == -1) {\n                throw new StarRocksConnectorException(\n                        CommonErrorCodeDeprecated.ILLEGAL_ARGUMENT,\n                        \"Failed to parse delimiter: `Hex str is empty`\");\n            }\n        }\n        // transform to separator\n        StringWriter writer = new StringWriter();\n        for (byte b : hexStrToBytes(hexStr)) {","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/serialize/StarRocksDelimiterParser.java#L24-L60","documentation":"StarRocksDelimiterParser.parse handles delimiters given in hex form like '\\x09'. When the value starts with \\x (case-insensitive), the remainder after '\\X' is treated as hex; if that remainder is empty (the delimiter is literally '\\x' or '\\X'), an ILLEGAL_ARGUMENT StarRocksConnectorException is thrown because an empty hex string encodes no separator.","triggerScenarios":"Configuring a delimiter option as \"\\\\x\" or \"\\\\X\" with no hex digits following — e.g. delimiter = \"\\\\x\" in the HOCON file.","commonSituations":"Copy-paste errors truncating '\\\\x09' to '\\\\x'; misunderstanding the hex-delimiter feature and thinking \\\\x alone means 'hex mode'.","solutions":["Provide the full hex encoding of the delimiter, e.g. \"\\\\x09\" for tab or \"\\\\x2C\" for comma","Use the literal character instead (e.g. delimiter = \"\\t\") if hex encoding isn't needed","Validate the delimiter config before submitting the job"],"exampleFix":"// before\n delimiter = \"\\\\x\"\n// after\n delimiter = \"\\\\x09\" // or a literal \"\\t\"","handlingStrategy":"validation","validationCode":"String d = config.getString(\"delimiter\"); if (d != null && d.toUpperCase().startsWith(\"\\\\X\") && d.length() <= 2) throw new IllegalArgumentException(\"hex delimiter needs digits after \\\\x, e.g. \\\\x09\");","typeGuard":"boolean isCompleteHexDelimiter(String s) { return !(s.toUpperCase().startsWith(\"\\\\X\")) || s.length() > 2; }","tryCatchPattern":"try { submitJob(cfg); } catch (StarRocksConnectorException e) { if (e.getErrorCode() == CommonErrorCodeDeprecated.ILLEGAL_ARGUMENT && e.getMessage().contains(\"Failed to parse delimiter\")) { /* fix delimiter value in config */ } throw e; }","preventionTips":["Always write hex delimiters with at least two hex digits (\\\\x09, \\\\x01)","Prefer literal characters for printable delimiters","Validate delimiter values in your config pipeline before submission"],"tags":["starrocks","config","delimiter","hex"],"backgroundTag":"invalid-argument-value","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"}