apache/seatunnel · error · SeaTunnelRuntimeException
FILE_SPLIT_SIZE_ILLEGAL
FILE_SPLIT_SIZE_ILLEGAL
Error message
file_split_size must be greater than 0 when enable_file_split=true, but got: %d
What it means
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.
Source
Thrown at seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/split/AccordingToSplitSizeSplitStrategy.java:66
* seek to locate the next delimiter around each split boundary.
*/
public class AccordingToSplitSizeSplitStrategy implements FileSplitStrategy, Closeable {
private static final int BUFFER_SIZE = 64 * 1024;
private final HadoopFileSystemProxy hadoopFileSystemProxy;
private final long skipHeaderRowNumber;
private final long splitSize;
private final byte[] delimiterBytes;
public AccordingToSplitSizeSplitStrategy(
HadoopConf hadoopConf,
String rowDelimiter,
long skipHeaderRowNumber,
String encodingName,
long splitSize) {
if (splitSize <= 0) {
throw new SeaTunnelRuntimeException(
FileConnectorErrorCode.FILE_SPLIT_SIZE_ILLEGAL,
String.format(
"file_split_size must be greater than 0 when enable_file_split=true, but got: %d",
splitSize));
}
if (rowDelimiter == null || rowDelimiter.isEmpty()) {
throw new SeaTunnelRuntimeException(
FileConnectorErrorCode.FILE_SPLIT_FAIL, "rowDelimiter must not be empty");
}
this.hadoopFileSystemProxy = new HadoopFileSystemProxy(hadoopConf);
this.skipHeaderRowNumber = skipHeaderRowNumber;
this.splitSize = splitSize;
this.delimiterBytes = rowDelimiter.getBytes(Charset.forName(encodingName));
if (delimiterBytes.length == 0) {
throw new SeaTunnelRuntimeException(
FileConnectorErrorCode.FILE_SPLIT_FAIL,
"rowDelimiter must not be empty after encoding");
}View on GitHub (pinned to cf67b549a7)
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.
Example fix
// before enable_file_split = true file_split_size = 0 // after enable_file_split = true file_split_size = 104857600
Defensive patterns
Strategy: validation
Validate before calling
long splitSize = config.getLong("file_split_size");
if (config.getBoolean("enable_file_split") && splitSize <= 0) {
throw new IllegalArgumentException("file_split_size must be > 0");
} Prevention
- Never set file_split_size to 0 expecting unlimited.
- Remember the unit is bytes.
- Validate computed split sizes when templated.
When it happens
Trigger: Constructing the split strategy with splitSize <= 0, which happens when file_split_size is configured as 0 or negative with enable_file_split=true.
Common situations: User sets file_split_size = 0 expecting 'unlimited'; unit confusion (bytes vs MB) leading to negative values after conversion.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- FILE_SPLIT_FAIL
- CONFIG_VALIDATION_FAILED
- CONFIG_VALIDATION_FAILED
- The read columns configuration will be filtered by the schem
- The SQL config must contain at least one source table
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/8e33077a4c79f6aa.
Report an issue: GitHub.