{"record":{"id":"acfd4c5345227bf3","repo":"alibaba/DataX","slug":"biginteger","errorCode":null,"errorMessage":"参数 bigInteger 不能为空.","messagePattern":"参数 bigInteger 不能为空\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"common/src/main/java/com/alibaba/datax/common/util/RangeSplitUtil.java","lineNumber":107,"sourceCode":"            }\n\n            return result;\n        }\n    }\n\n    private static void checkIfBetweenRange(int value, int left, int right) {\n        if (value < left || value > right) {\n            throw new IllegalArgumentException(String.format(\"parameter can not <[%s] or >[%s].\",\n                    left, right));\n        }\n    }\n\n    /**\n     * 由于只支持 ascii 码对应字符，所以radix 范围为[1,128]\n     */\n    public static BigInteger stringToBigInteger(String aString, int radix) {\n        if (null == aString) {\n            throw new IllegalArgumentException(\"参数 bigInteger 不能为空.\");\n        }\n\n        checkIfBetweenRange(radix, 1, 128);\n\n        BigInteger result = BigInteger.ZERO;\n        BigInteger radixBigInteger = BigInteger.valueOf(radix);\n\n        int tempChar;\n        int k = 0;\n\n        for (int i = aString.length() - 1; i >= 0; i--) {\n            tempChar = aString.charAt(i);\n            if (tempChar >= 128) {\n                throw new IllegalArgumentException(String.format(\"根据字符串进行切分时仅支持 ASCII 字符串，而字符串:[%s]非 ASCII 字符串.\", aString));\n            }\n            result = result.add(BigInteger.valueOf(tempChar).multiply(radixBigInteger.pow(k)));\n            k++;\n        }","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/alibaba/DataX/blob/80ec23d5c5328eb90ca364d2749e92dfaf44541e/common/src/main/java/com/alibaba/datax/common/util/RangeSplitUtil.java#L89-L125","documentation":"RangeSplitUtil.stringToBigInteger(String, int radix) throws IllegalArgumentException('参数 bigInteger 不能为空.') when the input string is null. It encodes an ASCII string into a BigInteger (base-radix positional encoding of char codes) so string ranges can be split numerically; a null string has no encoding.","triggerScenarios":"Calling stringToBigInteger(null, radix). Occurs when a string splitPk's boundary value is null — e.g. the reader could not obtain min/max string values, or a config key holding the string range was absent.","commonSituations":"String-type splitPk on a nullable column; job JSON missing the range parameter that gets passed through to the splitter.","solutions":["Ensure the splitPk string column is NOT NULL and contains data.","Check that the job config actually supplies the string range values (no missing/misspelled keys).","Null-check before calling and fall back to a non-split single task."],"exampleFix":"// before\nBigInteger start = RangeSplitUtil.stringToBigInteger(startStr, radix);\n\n// after\nif (startStr == null || endStr == null) {\n    return false; // caller: skip string splitting\n}\nBigInteger start = RangeSplitUtil.stringToBigInteger(startStr, radix);","handlingStrategy":"type-guard","validationCode":"if (str == null) { /* skip string split */ }\nBigInteger v = RangeSplitUtil.stringToBigInteger(str, radix);","typeGuard":"static boolean splittableString(String s, int radix) {\n    return s != null && radix >= 1 && radix <= 128;\n}","tryCatchPattern":null,"preventionTips":["Ensure splitPk string column is NOT NULL and populated.","Guard null boundary strings before encoding."],"tags":["datax","split","string","null-safety"],"backgroundTag":null,"analyzedSha":"80ec23d5c5328eb90ca364d2749e92dfaf44541e","analyzedAt":"2026-08-14T15:33:51.187Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}