{"record":{"id":"37ca2412f601b2f4","repo":"apache/seatunnel","slug":"file-split-size-illegal-37ca24","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":"error_code","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/ParquetFileSplitStrategy.java","lineNumber":59,"sourceCode":" * FileSourceSplit}s by merging one or more contiguous RowGroups according to the configured split\n * size. A split will never break a RowGroup, ensuring correctness and compatibility with Parquet\n * readers.\n *\n * <p>The generated split range ({@code start}, {@code length}) represents a byte range covering\n * complete RowGroups. The actual row-level reading and decoding are delegated to the Parquet reader\n * implementation.\n *\n * <p>This design enables efficient parallel reading of Parquet files while preserving Parquet\n * format semantics and avoiding invalid byte-level splits.\n */\npublic class ParquetFileSplitStrategy implements FileSplitStrategy, Closeable {\n\n    private final long splitSizeBytes;\n    private final HadoopFileSystemProxy hadoopFileSystemProxy;\n\n    public ParquetFileSplitStrategy(long splitSizeBytes) {\n        if (splitSizeBytes <= 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                            splitSizeBytes));\n        }\n        this.splitSizeBytes = splitSizeBytes;\n        this.hadoopFileSystemProxy = null;\n    }\n\n    public ParquetFileSplitStrategy(long splitSizeBytes, HadoopConf hadoopConf) {\n        if (splitSizeBytes <= 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                            splitSizeBytes));\n        }\n        this.splitSizeBytes = splitSizeBytes;","sourceCodeStart":41,"sourceCodeEnd":77,"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/ParquetFileSplitStrategy.java#L41-L77","documentation":"ParquetFileSplitStrategy's single-argument constructor validates that the split size in bytes is strictly positive, since parquet chunking cannot proceed with a zero/negative chunk size. A non-positive value raises FILE_SPLIT_SIZE_ILLEGAL via SeaTunnelRuntimeException.","triggerScenarios":"Code constructs new ParquetFileSplitStrategy(splitSizeBytes) with splitSizeBytes <= 0 — typically a misconfigured or defaulted FILE_SPLIT_SIZE value propagated from source config.","commonSituations":"Programmatic use of the split strategy with an uninitialized long (0); config where file_split_size was omitted or set to a negative number; template substitution failures.","solutions":["Pass a positive byte size, e.g. new ParquetFileSplitStrategy(134217728).","Fix the upstream file_split_size config to be > 0.","If constructing programmatically, validate/guard the value before invoking the constructor.","Remove the splitting strategy entirely if whole-file reads suffice."],"exampleFix":"// before\nnew ParquetFileSplitStrategy(0)\n// after\nnew ParquetFileSplitStrategy(134217728L)","handlingStrategy":"validation","validationCode":"if (splitSizeBytes <= 0) throw new IllegalArgumentException(\"ParquetFileSplitStrategy requires splitSizeBytes > 0\");\nnew ParquetFileSplitStrategy(splitSizeBytes);","typeGuard":"boolean isValidSplitSize(long bytes) { return bytes > 0; }","tryCatchPattern":"try { strategy = new ParquetFileSplitStrategy(size); } catch (SeaTunnelRuntimeException e) { if (e.getSeaTunnelErrorCode() == FileConnectorErrorCode.FILE_SPLIT_SIZE_ILLEGAL) { /* correct size or skip splitting */ } throw e; }","preventionTips":["Initialize split-size variables with valid positive defaults, not 0.","Validate config-derived longs before constructing the strategy.","Use constants (e.g. 128MB) instead of hand-typed values.","Only construct the strategy when file splitting is actually enabled."],"tags":["parquet","file-split","constructor","validation"],"backgroundTag":"invalid-constructor-argument","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"}