{"record":{"id":"6d472b314e01fdfd","repo":"apache/flink","slug":"the-value-number-cannot-be-re-represented-as-6","errorCode":null,"errorMessage":"The value '{number}' cannot be re represented as 64bit number (numeric overflow).","messagePattern":"The value '(.+?)' cannot be re represented as 64bit number \\(numeric overflow\\)\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink-core-api/src/main/java/org/apache/flink/configuration/MemorySize.java","lineNumber":294,"sourceCode":"        int pos = 0;\n\n        char current;\n        while (pos < len && (current = trimmed.charAt(pos)) >= '0' && current <= '9') {\n            pos++;\n        }\n\n        final String number = trimmed.substring(0, pos);\n        final String unit = trimmed.substring(pos).trim().toLowerCase(Locale.US);\n\n        if (number.isEmpty()) {\n            throw new NumberFormatException(\"text does not start with a number\");\n        }\n\n        final long value;\n        try {\n            value = Long.parseLong(number); // this throws a NumberFormatException on overflow\n        } catch (NumberFormatException e) {\n            throw new IllegalArgumentException(\n                    \"The value '\"\n                            + number\n                            + \"' cannot be re represented as 64bit number (numeric overflow).\");\n        }\n\n        final long multiplier = parseUnit(unit).map(MemoryUnit::getMultiplier).orElse(1L);\n        final long result = value * multiplier;\n\n        // check for overflow\n        if (result / multiplier != value) {\n            throw new IllegalArgumentException(\n                    \"The value '\"\n                            + text\n                            + \"' cannot be re represented as 64bit number of bytes (numeric overflow).\");\n        }\n\n        return result;\n    }","sourceCodeStart":276,"sourceCodeEnd":312,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-core-api/src/main/java/org/apache/flink/configuration/MemorySize.java#L276-L312","documentation":"MemorySize.parseBytes rethrows as IllegalArgumentException with 'cannot be re represented as 64bit number (numeric overflow)' when Long.parseLong fails on the digit substring. The numeric part alone (before any unit multiplier) must fit in a signed 64-bit long; anything with 20+ digits fails here. The message text contains a known typo ('re represented').","triggerScenarios":"parseBytes(\"99999999999999999999b\"); a byte count copied from a calculator in the wrong scale (e.g. entering bytes instead of the intended unit).","commonSituations":"Users specifying absurdly large raw byte values instead of using units like tb; generated config writing full-precision values that exceed long range.","solutions":["Use a unit suffix to keep the numeric part small: 8tb instead of 8796093022208b is fine, but larger raw numbers are not","Check the intended unit — values beyond ~8TB (Long.MAX_VALUE bytes) cannot be represented by MemorySize at all","Fix the generator producing 20+ digit numbers"],"exampleFix":"# before (numeric overflow)\nsize: 99999999999999999999\n\n# after\nsize: 100tb  # or another representable value","handlingStrategy":"validation","validationCode":"String numPart = raw.trim().split(\"[^0-9]\", 2)[0];\nif (numPart.length() > 18) { // 19+ digits risk exceeding Long.MAX_VALUE (9.22e18)\n    throw new IllegalArgumentException(\"Numeric part too large: \" + numPart);\n}\nlong bytes = MemorySize.parseBytes(raw);","typeGuard":null,"tryCatchPattern":"catch (IllegalArgumentException e) { /* numeric overflow — check intended unit and magnitude, then fix the config value */ }","preventionTips":["Keep the numeric part small by using unit suffixes","Values beyond ~8 exabytes are unrepresentable by MemorySize at all"],"tags":["memory","parsing","overflow","configuration","flink-core-api"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}