{"record":{"id":"6880193bdef2faee","repo":"prestodb/presto","slug":"invalid-session-property-688019","errorCode":"INVALID_SESSION_PROPERTY","errorMessage":"Invalid value for %s: %s. It must be between 0 and 400.","messagePattern":"Invalid value for (.+?): (.+?)\\. It must be between 0 and 400\\.","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"warning","filePath":"presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergSessionProperties.java","lineNumber":207,"sourceCode":"                        icebergConfig.getStatisticSnapshotRecordDifferenceWeight(),\n                        false))\n                .add(booleanProperty(\n                        DELETE_AS_JOIN_REWRITE_ENABLED,\n                        \"When enabled equality delete row filtering will be pushed down into a join.\",\n                        icebergConfig.isDeleteAsJoinRewriteEnabled(),\n                        false))\n                .add(new PropertyMetadata<>(\n                        DELETE_AS_JOIN_REWRITE_MAX_DELETE_COLUMNS,\n                        \"The maximum number of columns that can be used in a delete as join rewrite. \" +\n                                \"If the number of columns exceeds this value, the delete as join rewrite will not be applied.\",\n                        INTEGER,\n                        Integer.class,\n                        icebergConfig.getDeleteAsJoinRewriteMaxDeleteColumns(),\n                        false,\n                        value -> {\n                            int intValue = ((Number) value).intValue();\n                            if (intValue < 0 || intValue > 400) {\n                                throw new PrestoException(INVALID_SESSION_PROPERTY,\n                                        format(\"Invalid value for %s: %s. It must be between 0 and 400.\", DELETE_AS_JOIN_REWRITE_MAX_DELETE_COLUMNS, intValue));\n                            }\n                            return intValue;\n                        },\n                        integer -> integer))\n                .add(integerProperty(\n                        ROWS_FOR_METADATA_OPTIMIZATION_THRESHOLD,\n                        \"The max partitions number to utilize metadata optimization. When partitions number \" +\n                                \"of an Iceberg table exceeds this threshold, metadata optimization would be skipped for \" +\n                                \"the table. A value of 0 means skip metadata optimization directly.\",\n                        icebergConfig.getRowsForMetadataOptimizationThreshold(),\n                        false))\n                .add(integerProperty(STATISTICS_KLL_SKETCH_K_PARAMETER,\n                        \"The K parameter for the Apache DataSketches KLL sketch when computing histogram statistics\",\n                        icebergConfig.getStatisticsKllSketchKParameter(),\n                        false))\n                .add(new PropertyMetadata<>(\n                        MAX_PARTITIONS_PER_WRITER,","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergSessionProperties.java#L189-L225","documentation":"IcebergSessionProperties validates session property values with a checker for DELETE_AS_JOIN_REWRITE_MAX_DELETE_COLUMNS: the integer must be within [0, 400]. Values outside this range raise INVALID_SESSION_PROPERTY, so the session property cannot be set with an out-of-range number.","triggerScenarios":"SET SESSION iceberg.delete_as_join_rewrite_max_delete_columns = <n> (or equivalent API/Config setting) where n < 0 or n > 400; the Number.intValue() of the supplied value fails the bounds check.","commonSituations":"Typo (e.g. 4000 instead of 400); copy-pasting a value from a different connector's property with different limits; setting -1 expecting 'unlimited' semantics.","solutions":["Set the property to a value between 0 and 400 inclusive","Use 0 to effectively disable the rewrite via column-count threshold, if that was the intent","Remove the custom value to fall back to the IcebergConfig default"],"exampleFix":"// before\nSET SESSION iceberg.delete_as_join_rewrite_max_delete_columns = 500;\n// after\nSET SESSION iceberg.delete_as_join_rewrite_max_delete_columns = 400;","handlingStrategy":"validation","validationCode":"int v = Integer.parseInt(value);\nif (v < 0 || v > 400) throw new IllegalArgumentException(\n    \"delete_as_join_rewrite_max_delete_columns must be between 0 and 400, got \" + v);","typeGuard":null,"tryCatchPattern":"try { session.setProperty(\"delete_as_join_rewrite_max_delete_columns\", value); }\ncatch (PrestoException e) {\n  if (INVALID_SESSION_PROPERTY.toErrorCode().equals(e.getErrorCode())) {\n    // clamp to [0,400] and retry\n  } else throw e;\n}","preventionTips":["Clamp user-supplied values to [0,400] before applying session properties","Document the valid range next to the property in tooling","Avoid -1 sentinels; use 0 to disable via threshold"],"tags":["iceberg","session-property","validation","configuration"],"backgroundTag":"invalid-session-property","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}