prestodb/presto · warning · PrestoException

INVALID_SESSION_PROPERTY

INVALID_SESSION_PROPERTY

Error message

%s must be between 0.0 and 100.0 inclusive: %s

What it means

HiveCommonSessionProperties registers the orc_optimized_writer_validation_percentage session property with a validator that requires the value to be between 0.0 and 100.0 inclusive. Values outside that range raise INVALID_SESSION_PROPERTY naming the property and the offending value. It is a client-side session configuration validation, thrown before any query work happens.

Source

Thrown at presto-hive-common/src/main/java/com/facebook/presto/hive/HiveCommonSessionProperties.java:136

                        "Experimental: ORC: Force all validation for files",
                        hiveCommonClientConfig.getOrcWriterValidationPercentage() > 0.0,
                        false),
                stringProperty(
                        ORC_OPTIMIZED_WRITER_VALIDATE_MODE,
                        "Experimental: ORC: Level of detail in ORC validation",
                        hiveCommonClientConfig.getOrcWriterValidationMode().toString(),
                        false),
                new PropertyMetadata<>(
                        ORC_OPTIMIZED_WRITER_VALIDATE_PERCENTAGE,
                        "Experimental: ORC: sample percentage for validation for files",
                        DOUBLE,
                        Double.class,
                        hiveCommonClientConfig.getOrcWriterValidationPercentage(),
                        false,
                        value -> {
                            double doubleValue = ((Number) value).doubleValue();
                            if (doubleValue < 0.0 || doubleValue > 100.0) {
                                throw new PrestoException(
                                        INVALID_SESSION_PROPERTY,
                                        format("%s must be between 0.0 and 100.0 inclusive: %s", ORC_OPTIMIZED_WRITER_VALIDATE_PERCENTAGE, doubleValue));
                            }
                            return doubleValue;
                        },
                        value -> value),
                dataSizeSessionProperty(
                        ORC_STREAM_BUFFER_SIZE,
                        "ORC: Size of buffer for streaming reads",
                        hiveCommonClientConfig.getOrcStreamBufferSize(),
                        false),
                dataSizeSessionProperty(
                        ORC_TINY_STRIPE_THRESHOLD,
                        "ORC: Threshold below which an ORC stripe or file will read in its entirety",
                        hiveCommonClientConfig.getOrcTinyStripeThreshold(),
                        false),
                booleanProperty(
                        ORC_ZSTD_JNI_DECOMPRESSION_ENABLED,

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Set the property to a value in [0.0, 100.0], e.g. SET SESSION orc_optimized_writer_validation_percentage = 10.0;
  2. If you intended a fraction, convert to percentage: 0.5 -> 50.0.
  3. Check client-side automation (JDBC/ODBC session properties) for out-of-range computed values.
  4. Reset the property: RESET SESSION orc_optimized_writer_validation_percentage;

Example fix

// before
SET SESSION orc_optimized_writer_validation_percentage = 150.0;
// after
SET SESSION orc_optimized_writer_validation_percentage = 100.0;
Defensive patterns

Strategy: validation

Validate before calling

double v = Double.parseDouble(props.getProperty("orc_optimized_writer_validation_percentage", "0"));
if (v < 0.0 || v > 100.0) {
    throw new IllegalArgumentException("must be between 0.0 and 100.0 inclusive: " + v);
}

Try / catch

try {
    session.setProperty("orc_optimized_writer_validation_percentage", value);
} catch (PrestoException e) {
    if (e.getErrorCode() == INVALID_SESSION_PROPERTY.toErrorCode()) {
        // clamp to [0,100] and retry
    }
}

Prevention

When it happens

Trigger: SET SESSION orc_optimized_writer_validation_percentage = <value> (or a client setting the property) with value < 0.0 or > 100.0, e.g. 150 or -5.

Common situations: Confusing percentage with probability fraction (entering 0.5 intending 50%); tooling that passes 100.5 due to float math; hand-edited JDBC session properties.

Related errors


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