{"record":{"id":"f30f2d34c7ba967f","repo":"prestodb/presto","slug":"min-file-size-bytes-must-be-a-valid-long-got-s","errorCode":null,"errorMessage":"min-file-size-bytes must be a valid long, got: %s","messagePattern":"min-file-size-bytes must be a valid long, got: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergUtil.java","lineNumber":1819,"sourceCode":"     * @return minimum file size threshold in bytes\n     * @throws IllegalArgumentException if the value is invalid\n     */\n    public static long parseMinFileSize(Map<String, String> options)\n    {\n        String minFileSizeStr = options.get(\"min-file-size-bytes\");\n        if (minFileSizeStr == null) {\n            return 0;\n        }\n        try {\n            long minFileSize = Long.parseLong(minFileSizeStr);\n            if (minFileSize < 0) {\n                throw new IllegalArgumentException(\n                    String.format(\"min-file-size-bytes must be non-negative, got: %s\", minFileSize));\n            }\n            return minFileSize;\n        }\n        catch (NumberFormatException e) {\n            throw new IllegalArgumentException(\n                String.format(\"min-file-size-bytes must be a valid long, got: %s\", minFileSizeStr), e);\n        }\n    }\n\n    /**\n     * Parses and validates the max-file-size-bytes option value.\n     * Returns the parsed long value, or 0 if the option is not present.\n     *\n     * @throws IllegalArgumentException if the value is invalid\n     */\n    public static long parseMaxFileSize(Map<String, String> options)\n    {\n        String maxFileSizeStr = options.get(\"max-file-size-bytes\");\n        if (maxFileSizeStr == null) {\n            return 0;\n        }\n        try {\n            long maxFileSize = Long.parseLong(maxFileSizeStr);","sourceCodeStart":1801,"sourceCodeEnd":1837,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergUtil.java#L1801-L1837","documentation":"The min-file-size-bytes option must parse as a long; when Long.parseLong throws NumberFormatException it is rethrown as IllegalArgumentException with this message and the raw string interpolated. Null input is handled separately (returns 0), so this only fires on malformed non-null values.","triggerScenarios":"Calling optimize with min-file-size-bytes like '10MB', '5m', '1048576.0', or any non-integer string — suffixes are not parsed here.","commonSituations":"Passing human-readable byte sizes ('100MB') instead of raw byte counts; floats from JSON configs; thousands separators like '1,048,576'.","solutions":["Convert the size to a plain raw byte integer string, e.g. '104857600' for 100MB.","Do unit conversion in the calling application before building the option map.","Remove separators/decimals: use Long.toString(longValue)."],"exampleFix":"// before\nCALL system.optimize('db.t', map(ARRAY['min_file_size_bytes'], ARRAY['100MB']));\n// after\nCALL system.optimize('db.t', map(ARRAY['min_file_size_bytes'], ARRAY['104857600']));","handlingStrategy":"validation","validationCode":"String v = raw.trim();\nif (!v.matches(\"\\\\d+\")) throw new IllegalArgumentException(\"min-file-size-bytes must be raw bytes, no suffixes\");\nLong.parseLong(v);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Convert units (MB/GB) to raw bytes in application code before building options.","Never pass human-readable sizes directly; store byte counts in config.","Round floats to long explicitly before stringifying."],"tags":["iceberg","validation","number-format","argument-parsing"],"backgroundTag":"invalid-procedure-option-value","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}