{"record":{"id":"d91ce38d1cd36067","repo":"apache/seatunnel","slug":"file-split-size-illegal-d91ce3","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/FileSplitStrategyFactory.java","lineNumber":68,"sourceCode":"        CompressFormat compressCodec = readonlyConfig.get(FileBaseSourceOptions.COMPRESS_CODEC);\n        ArchiveCompressFormat archiveCompressCodec =\n                readonlyConfig.get(FileBaseSourceOptions.ARCHIVE_COMPRESS_CODEC);\n        if (compressCodec != CompressFormat.NONE\n                || archiveCompressCodec != ArchiveCompressFormat.NONE) {\n            log.warn(\n                    \"enable_file_split=true but compress_codec={} or archive_compress_codec={} is not NONE. \"\n                            + \"Falling back to non-splitting mode.\",\n                    compressCodec,\n                    archiveCompressCodec);\n            return new DefaultFileSplitStrategy();\n        }\n\n        Objects.requireNonNull(\n                hadoopConf, \"hadoopConf must not be null when file split is enabled\");\n\n        long fileSplitSize = readonlyConfig.get(FileBaseSourceOptions.FILE_SPLIT_SIZE);\n        if (fileSplitSize <= 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                            fileSplitSize));\n        }\n        if (FileFormat.PARQUET == fileFormat) {\n            return new ParquetFileSplitStrategy(fileSplitSize, hadoopConf);\n        }\n        String rowDelimiter =\n                !readonlyConfig.getOptional(FileBaseSourceOptions.ROW_DELIMITER).isPresent()\n                        ? DEFAULT_ROW_DELIMITER\n                        : readonlyConfig.get(FileBaseSourceOptions.ROW_DELIMITER);\n        long skipHeaderRowNumber =\n                readonlyConfig.get(FileBaseSourceOptions.CSV_USE_HEADER_LINE)\n                        ? 1L\n                        : readonlyConfig.get(FileBaseSourceOptions.SKIP_HEADER_ROW_NUMBER);\n        String encodingName = readonlyConfig.get(FileBaseSourceOptions.ENCODING);\n        return new AccordingToSplitSizeSplitStrategy(","sourceCodeStart":50,"sourceCodeEnd":86,"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/FileSplitStrategyFactory.java#L50-L86","documentation":"When enable_file_split=true, FILE_SPLIT_SIZE must be a positive byte value because it defines the size of each file chunk. The factory validates the configured value and throws FILE_SPLIT_SIZE_ILLEGAL (SeaTunnelRuntimeException) for zero or negative sizes.","triggerScenarios":"Config sets enable_file_split=true while file_split_size is 0, negative, or the option default resolves to a non-positive long when read via readonlyConfig.get(FileBaseSourceOptions.FILE_SPLIT_SIZE) in initFileSplitStrategy.","commonSituations":"Users forgetting to set file_split_size after enabling splitting; unit mistakes (writing '0' or a negative number); templating errors producing an empty/zero value.","solutions":["Set file_split_size to a positive number of bytes, e.g. 134217728 (128MB).","Remove enable_file_split=true if whole-file reading is intended, which avoids needing file_split_size.","Verify the resolved value type is a plain long (no 'MB' suffix strings, which parse to 0).","Check for template placeholders rendering to 0 and fix the variable."],"exampleFix":"// before\nenable_file_split = true\nfile_split_size = 0\n// after\nenable_file_split = true\nfile_split_size = 134217728","handlingStrategy":"validation","validationCode":"long size = readonlyConfig.get(FileBaseSourceOptions.FILE_SPLIT_SIZE);\nif (enableFileSplit && size <= 0) throw new IllegalArgumentException(\"file_split_size must be > 0\");","typeGuard":null,"tryCatchPattern":"try { strategy = FileSplitStrategyFactory.initFileSplitStrategy(cfg, conf, format); } catch (SeaTunnelRuntimeException e) { if (e.getSeaTunnelErrorCode() == FileConnectorErrorCode.FILE_SPLIT_SIZE_ILLEGAL) { /* fix config or disable splitting */ } throw e; }","preventionTips":["Set file_split_size to a positive byte count whenever enable_file_split=true.","Never leave file_split_size at 0 or negative in templates.","Remember the value is plain bytes, not 'MB' strings.","Run config validation before submitting the job."],"tags":["config","file-split","parquet","validation"],"backgroundTag":"value-out-of-range","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"}