prestodb/presto · error · IllegalArgumentException

Invalid property name '%s'

Error message

Invalid property name '%s'

What it means

SessionPropertyMetadata validates session property names in its constructor. A name must be non-empty and already lowercased with no leading/trailing whitespace. This check keeps property identifiers canonical so they can be matched against SET/RESET SESSION statements.

Source

Thrown at presto-spi/src/main/java/com/facebook/presto/spi/session/SessionPropertyMetadata.java:53

    private final boolean hidden;

    @JsonCreator
    public SessionPropertyMetadata(
            @JsonProperty("name") String name,
            @JsonProperty("description") String description,
            @JsonProperty("typeSignature") TypeSignature typeSignature,
            @JsonProperty("defaultValue") String defaultValue,
            @JsonProperty("hidden") boolean hidden)
    {
        this.name = requireNonNull(name, "name is null");
        this.description = requireNonNull(description, "description is null");
        this.typeSignature = requireNonNull(typeSignature, "typeSignature is null");
        this.defaultValue = defaultValue;
        this.hidden = hidden;

        if (name.isEmpty() || !name.trim().toLowerCase(ENGLISH).equals(name)) {
            throw new IllegalArgumentException(format("Invalid property name '%s'", name));
        }
        if (description.isEmpty() || !description.trim().equals(description)) {
            throw new IllegalArgumentException(format("Invalid property description '%s'", description));
        }
    }

    /**
     * Name of the property.  This must be a valid identifier.
     */
    @JsonProperty
    public String getName()
    {
        return name;
    }

    /**
     * Description for the end user.
     */

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Rename the property to all-lowercase (e.g. 'myprop')
  2. Trim the name string before constructing the metadata
  3. Ensure the name is not empty before constructing
  4. Apply String.toLowerCase(ENGLISH).trim() to the value passed in

Example fix

// before
new SessionPropertyMetadata("MaxSplits", ...
// after
new SessionPropertyMetadata("max_splits", ...
Defensive patterns

Strategy: validation

Validate before calling

if (name == null || name.isEmpty() || !name.trim().toLowerCase(Locale.ENGLISH).equals(name)) { throw new IllegalArgumentException("property name must be non-empty lowercase, got: " + name); }

Type guard

boolean isValidPropertyName(String name) { return name != null && !name.isEmpty() && name.trim().toLowerCase(Locale.ENGLISH).equals(name); }

Prevention

When it happens

Trigger: Calling the SessionPropertyMetadata constructor (directly or via builder) with an empty name, a name containing uppercase letters, or surrounding whitespace, e.g. new SessionPropertyMetadata("MyProp", ...).

Common situations: Plugin/connector authors defining system or catalog session properties with camelCase or mixed-case names, or copying property names from UIs/logs that picked up trailing spaces.

Related errors


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