prestodb/presto · warning · PrestoException

INVALID_SESSION_PROPERTY

INVALID_SESSION_PROPERTY

Error message

Invalid value for %s: %s. It must be between 0 and 400.

What it means

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.

Source

Thrown at presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergSessionProperties.java:207

                        icebergConfig.getStatisticSnapshotRecordDifferenceWeight(),
                        false))
                .add(booleanProperty(
                        DELETE_AS_JOIN_REWRITE_ENABLED,
                        "When enabled equality delete row filtering will be pushed down into a join.",
                        icebergConfig.isDeleteAsJoinRewriteEnabled(),
                        false))
                .add(new PropertyMetadata<>(
                        DELETE_AS_JOIN_REWRITE_MAX_DELETE_COLUMNS,
                        "The maximum number of columns that can be used in a delete as join rewrite. " +
                                "If the number of columns exceeds this value, the delete as join rewrite will not be applied.",
                        INTEGER,
                        Integer.class,
                        icebergConfig.getDeleteAsJoinRewriteMaxDeleteColumns(),
                        false,
                        value -> {
                            int intValue = ((Number) value).intValue();
                            if (intValue < 0 || intValue > 400) {
                                throw new PrestoException(INVALID_SESSION_PROPERTY,
                                        format("Invalid value for %s: %s. It must be between 0 and 400.", DELETE_AS_JOIN_REWRITE_MAX_DELETE_COLUMNS, intValue));
                            }
                            return intValue;
                        },
                        integer -> integer))
                .add(integerProperty(
                        ROWS_FOR_METADATA_OPTIMIZATION_THRESHOLD,
                        "The max partitions number to utilize metadata optimization. When partitions number " +
                                "of an Iceberg table exceeds this threshold, metadata optimization would be skipped for " +
                                "the table. A value of 0 means skip metadata optimization directly.",
                        icebergConfig.getRowsForMetadataOptimizationThreshold(),
                        false))
                .add(integerProperty(STATISTICS_KLL_SKETCH_K_PARAMETER,
                        "The K parameter for the Apache DataSketches KLL sketch when computing histogram statistics",
                        icebergConfig.getStatisticsKllSketchKParameter(),
                        false))
                .add(new PropertyMetadata<>(
                        MAX_PARTITIONS_PER_WRITER,

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Set the property to a value between 0 and 400 inclusive
  2. Use 0 to effectively disable the rewrite via column-count threshold, if that was the intent
  3. Remove the custom value to fall back to the IcebergConfig default

Example fix

// before
SET SESSION iceberg.delete_as_join_rewrite_max_delete_columns = 500;
// after
SET SESSION iceberg.delete_as_join_rewrite_max_delete_columns = 400;
Defensive patterns

Strategy: validation

Validate before calling

int v = Integer.parseInt(value);
if (v < 0 || v > 400) throw new IllegalArgumentException(
    "delete_as_join_rewrite_max_delete_columns must be between 0 and 400, got " + v);

Try / catch

try { session.setProperty("delete_as_join_rewrite_max_delete_columns", value); }
catch (PrestoException e) {
  if (INVALID_SESSION_PROPERTY.toErrorCode().equals(e.getErrorCode())) {
    // clamp to [0,400] and retry
  } else throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/6880193bdef2faee. Report an issue: GitHub.