{"record":{"id":"8e33077a4c79f6aa","repo":"apache/seatunnel","slug":"file-split-size-illegal","errorCode":"FILE_SPLIT_SIZE_ILLEGAL","errorMessage":"file_split_size must be greater than 0 when enable_file_split=true, but got: %d","messagePattern":"file_split_size must be greater than 0 when enable_file_split=true, but got: (.+?)","errorType":"validation","errorClass":"SeaTunnelRuntimeException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/split/AccordingToSplitSizeSplitStrategy.java","lineNumber":66,"sourceCode":" * seek to locate the next delimiter around each split boundary.\n */\npublic class AccordingToSplitSizeSplitStrategy implements FileSplitStrategy, Closeable {\n\n    private static final int BUFFER_SIZE = 64 * 1024;\n\n    private final HadoopFileSystemProxy hadoopFileSystemProxy;\n    private final long skipHeaderRowNumber;\n    private final long splitSize;\n    private final byte[] delimiterBytes;\n\n    public AccordingToSplitSizeSplitStrategy(\n            HadoopConf hadoopConf,\n            String rowDelimiter,\n            long skipHeaderRowNumber,\n            String encodingName,\n            long splitSize) {\n        if (splitSize <= 0) {\n            throw new SeaTunnelRuntimeException(\n                    FileConnectorErrorCode.FILE_SPLIT_SIZE_ILLEGAL,\n                    String.format(\n                            \"file_split_size must be greater than 0 when enable_file_split=true, but got: %d\",\n                            splitSize));\n        }\n        if (rowDelimiter == null || rowDelimiter.isEmpty()) {\n            throw new SeaTunnelRuntimeException(\n                    FileConnectorErrorCode.FILE_SPLIT_FAIL, \"rowDelimiter must not be empty\");\n        }\n        this.hadoopFileSystemProxy = new HadoopFileSystemProxy(hadoopConf);\n        this.skipHeaderRowNumber = skipHeaderRowNumber;\n        this.splitSize = splitSize;\n        this.delimiterBytes = rowDelimiter.getBytes(Charset.forName(encodingName));\n        if (delimiterBytes.length == 0) {\n            throw new SeaTunnelRuntimeException(\n                    FileConnectorErrorCode.FILE_SPLIT_FAIL,\n                    \"rowDelimiter must not be empty after encoding\");\n        }","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/split/AccordingToSplitSizeSplitStrategy.java#L48-L84","documentation":"AccordingToSplitSizeSplitStrategy's constructor validates that file_split_size is positive when enable_file_split=true. A non-positive split size makes chunked reading meaningless, so FILE_SPLIT_SIZE_ILLEGAL is thrown.","triggerScenarios":"Constructing the split strategy with splitSize <= 0, which happens when file_split_size is configured as 0 or negative with enable_file_split=true.","commonSituations":"User sets file_split_size = 0 expecting 'unlimited'; unit confusion (bytes vs MB) leading to negative values after conversion.","solutions":["Set file_split_size to a positive value (bytes), e.g. 104857600 for 100MB.","Remove file_split_size (and enable_file_split) to use default whole-file splits.","Check any variable/template substitution producing 0 or negative values."],"exampleFix":"// before\nenable_file_split = true\nfile_split_size = 0\n// after\nenable_file_split = true\nfile_split_size = 104857600","handlingStrategy":"validation","validationCode":"long splitSize = config.getLong(\"file_split_size\");\nif (config.getBoolean(\"enable_file_split\") && splitSize <= 0) {\n  throw new IllegalArgumentException(\"file_split_size must be > 0\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never set file_split_size to 0 expecting unlimited.","Remember the unit is bytes.","Validate computed split sizes when templated."],"tags":["file-connector","split","config-validation"],"backgroundTag":"invalid-config-value","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}