prestodb/presto · error · PrestoException

NOT_SUPPORTED

NOT_SUPPORTED

Error message

Clearing materialized view property %s is not supported

What it means

Thrown by serializeForUpdate when an UPDATE supplies null for a materialized view property. Even for updatable properties, the Iceberg connector does not support clearing (resetting to null) a property value on an existing materialized view; the serializer requires a non-null value to apply.

Source

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

                .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"));
    }

    private static final class MaterializedViewProperty
    {
        private final PropertyMetadata<?> metadata;

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Set the property to an explicit non-null value instead of null.
  2. Drop and recreate the materialized view without the property to get its default.
  3. Remove the null-valued property from the SET PROPERTIES list.
  4. If reset semantics are needed, file/look for a Presto feature request for property clearing.

Example fix

// before
ALTER MATERIALIZED VIEW mv SET PROPERTIES target_max_file_size = NULL;
// after
ALTER MATERIALIZED VIEW mv SET PROPERTIES target_max_file_size = '1GB';
Defensive patterns

Strategy: validation

Validate before calling

// Java: ensure the value is non-null before serializeForUpdate
if (value == null) {
    throw new IllegalArgumentException("Cannot clear MV property " + name + "; provide a non-null value");
}

Type guard

boolean isClearOperation(String name, Object value) {
    return value == null && MV_ONLY_PROPERTIES_BY_NAME.containsKey(name);
} // if true, handle via drop/recreate instead of ALTER

Try / catch

try {
    serializeForUpdate(name, value);
} catch (PrestoException e) {
    if (e.getErrorCode().getCode() == StandardErrorCode.NOT_SUPPORTED.getCode() && value == null) {
        // fallback: drop + recreate the materialized view without the property
    } else throw e;
}

Prevention

When it happens

Trigger: ALTER MATERIALIZED VIEW ... SET PROPERTIES prop = NULL, or any code path calling serializeForUpdate(name, null) for a property that passed the updatable check.

Common situations: A migration/tool script generates SET PROPERTIES with null values from a diff; users expecting SQL-standard 'SET prop = DEFAULT' reset semantics; ORM-like frameworks emitting null to unset attributes.

Understand the failure class

Background: Presto NOT_SUPPORTED error: what "not supported" means and how to fix it — this error's family across 3 libraries.

Related errors


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