prestodb/presto · error · PrestoException

INVALID_SESSION_PROPERTY

INVALID_SESSION_PROPERTY

Error message

%s must be non-null

What it means

Thrown by NativeWorkerSessionPropertyProvider.validateIntegerRange when a native-execution integer session property is supplied as null. The provider validates every session property value against its declared type and range before passing it to native workers; null is rejected outright because there is no meaningful default at this layer.

Source

Thrown at presto-main-base/src/main/java/com/facebook/presto/sessionpropertyproviders/NativeWorkerSessionPropertyProvider.java:581

                        NATIVE_RPC_RATELIMITER_MAX_LIMIT,
                        "Native Execution only. Ceiling for the per-tier RPC rate-limiter max-pending " +
                                "cap. Default 200 (validated for LLM-inference backends); 0 falls back to " +
                                "the built-in 20. Admission-controlled dispatch makes this cap bind; the " +
                                "adaptive limiter shrinks from here under overload.",
                        200L,
                        !nativeExecution),
                longProperty(
                        NATIVE_RPC_CONGESTION_MAX_WINDOW,
                        "Native Execution only. Ceiling for the per-driver RPC congestion window " +
                                "(0 = per-mode default: PER_ROW 100, BATCH 256).",
                        0L,
                        !nativeExecution));
    }

    private static Integer validateIntegerRange(Object value, String property, int lowerBoundIncluded, int upperBoundIncluded)
    {
        if (value == null) {
            throw new PrestoException(INVALID_SESSION_PROPERTY, format("%s must be non-null", property));
        }

        int intValue = ((Number) value).intValue();
        if (intValue < lowerBoundIncluded || intValue > upperBoundIncluded) {
            throw new PrestoException(
                    INVALID_SESSION_PROPERTY,
                    format("%s must be between %s and %s: %s", property, lowerBoundIncluded, upperBoundIncluded, intValue));
        }
        return intValue;
    }

    @Override
    public List<PropertyMetadata<?>> getSessionProperties()
    {
        return sessionProperties;
    }
}

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Supply a concrete integer value for the session property instead of null
  2. Remove the SET SESSION clause so the property falls back to its system default
  3. Check client-side why a null was bound (empty template variable, unset config) and fix the source
  4. If building properties in code, skip null values rather than adding them to the map

Example fix

// before
session.setAttribute("native_worker_property", null);
// after
Integer value = config.getProperty("native_worker_property", 1024);
session.setAttribute("native_worker_property", value);
Defensive patterns

Strategy: validation

Validate before calling

Object value = sessionPropertyMap.get(propertyName);
if (value == null) {
    throw new IllegalArgumentException(propertyName + " must be non-null");
}
if (!(value instanceof Number)) {
    throw new IllegalArgumentException(propertyName + " must be a number");
}

Type guard

boolean isValidIntegerProperty(Object value) {
    return value instanceof Number && ((Number) value).intValue() != 0 || value instanceof Integer;
}

Prevention

When it happens

Trigger: Calling getSessionProperties/system session property APIs with an explicit null value for an integer property (e.g. via SET SESSION x = NULL through JDBC/CLI, or a coordinator plugin passing null in the session properties map).

Common situations: Client drivers or BI tools binding a null parameter into SET SESSION; scripted query submission templating where a property value is empty and becomes null; connectors/plugins building session properties programmatically without null checks.

Related errors


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