{"record":{"id":"a39c8f928716ab23","repo":"prestodb/presto","slug":"iceberg-target-max-file-size-must-be-at-least-1-by","errorCode":null,"errorMessage":"iceberg.target-max-file-size must be at least 1 byte","messagePattern":"iceberg\\.target-max-file-size must be at least 1 byte","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergConfig.java","lineNumber":592,"sourceCode":"    public IcebergConfig setAggregatePushDownEnabled(boolean aggregatePushDownEnabled)\n    {\n        this.aggregatePushDownEnabled = aggregatePushDownEnabled;\n        return this;\n    }\n\n    @NotNull\n    public DataSize getTargetMaxFileSize()\n    {\n        return targetMaxFileSize;\n    }\n\n    @Min(1)\n    @Config(\"iceberg.target-max-file-size\")\n    @ConfigDescription(\"Target maximum size of written files; the actual size may be larger\")\n    public IcebergConfig setTargetMaxFileSize(DataSize targetMaxFileSize)\n    {\n        if (targetMaxFileSize.toBytes() < 1) {\n            throw new IllegalArgumentException(\"iceberg.target-max-file-size must be at least 1 byte\");\n        }\n        this.targetMaxFileSize = targetMaxFileSize;\n        return this;\n    }\n}\n","sourceCodeStart":574,"sourceCodeEnd":598,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergConfig.java#L574-L598","documentation":"A configuration validation error thrown by IcebergConfig.setTargetMaxFileSize when the value of iceberg.target-max-file-size is less than 1 byte. The setter enforces a @Min(1) constraint and an explicit byte check so the writer always has a positive file-size target.","triggerScenarios":"Setting iceberg.target-max-file-size=0B, a sub-byte unit, or otherwise non-positive DataSize in connector properties or config; also triggered programmatically when calling setTargetMaxFileSize with such a value.","commonSituations":"Typos in properties files (0B, -1), templated config with an unset/zero variable, or test code constructing IcebergConfig with invalid sizes.","solutions":["Set iceberg.target-max-file-size to a positive value, e.g. iceberg.target-max-file-size=512MB","Check config templating so the placeholder resolves to a real positive size rather than 0","If programmatic, call setTargetMaxFileSize(new DataSize(...)) with a value >= 1 byte"],"exampleFix":"// before\niceberg.target-max-file-size=0B\n// after\niceberg.target-max-file-size=512MB","handlingStrategy":"validation","validationCode":"DataSize size = DataSize.valueOf(configValue);\nif (size.toBytes() < 1) throw new IllegalArgumentException(\"iceberg.target-max-file-size must be >= 1 byte\");","typeGuard":null,"tryCatchPattern":"try { config.setTargetMaxFileSize(size); } catch (IllegalArgumentException e) { /* fall back to a sane default like DataSize.succinctDataSize(512, MEGABYTE) */ }","preventionTips":["Always specify a positive size with a unit in iceberg.properties","Validate templated config values resolve to non-zero sizes","Add config linting in CI for connector properties"],"tags":["iceberg","configuration","validation","data-size"],"backgroundTag":"invalid-config-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"}