prestodb/presto · error · PrestoException

INVALID_MATERIALIZED_VIEW_PROPERTY

INVALID_MATERIALIZED_VIEW_PROPERTY

Error message

Materialized view property is not updatable: %s

What it means

This error is thrown when trying to UPDATE a materialized view property that either does not exist in the Iceberg materialized view property registry (MV_ONLY_PROPERTIES_BY_NAME) or is marked as not updatable (creation-only). Iceberg materialized views have some properties that can only be set at creation time; serializeForUpdate validates every property change against the updatable() flag before serializing the new value.

Source

Thrown at presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergMaterializedViewProperties.java:170

        requireNonNull(tableProperties, "tableProperties is null");

        // Combine table properties (for storage table) with MV-specific properties
        materializedViewProperties = ImmutableList.<PropertyMetadata<?>>builder()
                .addAll(tableProperties.getTableProperties())
                .addAll(MV_ONLY_PROPERTIES.stream().map(MaterializedViewProperty::metadata).iterator())
                .build();
    }

    public List<PropertyMetadata<?>> getMaterializedViewProperties()
    {
        return materializedViewProperties;
    }

    public static Map.Entry<String, String> serializeForUpdate(String name, Object value)
    {
        MaterializedViewProperty property = MV_ONLY_PROPERTIES_BY_NAME.get(name);
        if (property == null || !property.updatable()) {
            throw new PrestoException(INVALID_MATERIALIZED_VIEW_PROPERTY,
                    format("Materialized view property is not updatable: %s", name));
        }
        if (value == null) {
            throw new PrestoException(NOT_SUPPORTED,
                    format("Clearing materialized view property %s is not supported", name));
        }
        return Map.entry(property.storageKey(), property.serializer().apply(value));
    }

    private static MaterializedViewProperty creationOnly(PropertyMetadata<?> metadata, String storageKey)
    {
        return new MaterializedViewProperty(metadata, storageKey, null);
    }

    private static MaterializedViewProperty updatable(PropertyMetadata<?> metadata, String storageKey, Function<Object, String> serializer)
    {
        return new MaterializedViewProperty(metadata, storageKey, requireNonNull(serializer, "serializer is null"));
    }

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Check the property name against IcebergMaterializedViewProperties (MV_ONLY_PROPERTIES_BY_NAME) for exact spelling.
  2. Verify with the connector docs whether the property is creation-only; if so, drop and recreate the materialized view with the desired value.
  3. Only pass properties whose updatable() returns true; filter the SET PROPERTIES list accordingly.
  4. Upgrade Presto if a newer version marks the property as updatable.

Example fix

// before
ALTER MATERIALIZED VIEW mv SET PROPERTIES some_creation_only_prop = 'x';
// after
-- recreate the view with the creation-only property
DROP MATERIALIZED VIEW mv;
CREATE MATERIALIZED VIEW mv WITH (some_creation_only_prop = 'x') AS SELECT ...;
Defensive patterns

Strategy: validation

Validate before calling

// Java: validate before calling serializeForUpdate / issuing ALTER
MaterializedViewProperty prop = MV_ONLY_PROPERTIES_BY_NAME.get(name);
if (prop == null) throw new IllegalArgumentException("Unknown MV property: " + name);
if (!prop.updatable()) throw new IllegalArgumentException("Property is creation-only: " + name);

Type guard

boolean isUpdatableProperty(String name) {
    MaterializedViewProperty p = MV_ONLY_PROPERTIES_BY_NAME.get(name);
    return p != null && p.updatable();
}

Try / catch

try {
    serializeForUpdate(name, value);
} catch (PrestoException e) {
    if (e.getErrorCode().getCode() == StandardErrorCode.INVALID_MATERIALIZED_VIEW_PROPERTY.getCode()) {
        // skip or recreate view; property is creation-only or unknown
    } else throw e;
}

Prevention

When it happens

Trigger: Calling ALTER MATERIALIZED VIEW ... SET PROPERTIES (which routes to serializeForUpdate) with a property name that is unknown to the Iceberg connector, or with a property that was registered via creationOnly(...) and therefore has updatable() == false.

Common situations: Typo in the property name in ALTER MATERIALIZED VIEW; attempting to modify a creation-only Iceberg MV property (e.g. one controlling storage layout) after the view exists; applying a generic Presto ALTER statement assuming all MV properties are mutable; version drift where a property was updatable in a newer Presto but not in the deployed one.

Related errors


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