{"record":{"id":"b4f9f88e0fac5f82","repo":"prestodb/presto","slug":"not-supported-b4f9f8","errorCode":"NOT_SUPPORTED","errorMessage":"Clearing materialized view property %s is not supported","messagePattern":"Clearing materialized view property (.+?) is not supported","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergMaterializedViewProperties.java","lineNumber":174,"sourceCode":"                .addAll(tableProperties.getTableProperties())\n                .addAll(MV_ONLY_PROPERTIES.stream().map(MaterializedViewProperty::metadata).iterator())\n                .build();\n    }\n\n    public List<PropertyMetadata<?>> getMaterializedViewProperties()\n    {\n        return materializedViewProperties;\n    }\n\n    public static Map.Entry<String, String> serializeForUpdate(String name, Object value)\n    {\n        MaterializedViewProperty property = MV_ONLY_PROPERTIES_BY_NAME.get(name);\n        if (property == null || !property.updatable()) {\n            throw new PrestoException(INVALID_MATERIALIZED_VIEW_PROPERTY,\n                    format(\"Materialized view property is not updatable: %s\", name));\n        }\n        if (value == null) {\n            throw new PrestoException(NOT_SUPPORTED,\n                    format(\"Clearing materialized view property %s is not supported\", name));\n        }\n        return Map.entry(property.storageKey(), property.serializer().apply(value));\n    }\n\n    private static MaterializedViewProperty creationOnly(PropertyMetadata<?> metadata, String storageKey)\n    {\n        return new MaterializedViewProperty(metadata, storageKey, null);\n    }\n\n    private static MaterializedViewProperty updatable(PropertyMetadata<?> metadata, String storageKey, Function<Object, String> serializer)\n    {\n        return new MaterializedViewProperty(metadata, storageKey, requireNonNull(serializer, \"serializer is null\"));\n    }\n\n    private static final class MaterializedViewProperty\n    {\n        private final PropertyMetadata<?> metadata;","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergMaterializedViewProperties.java#L156-L192","documentation":"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.","triggerScenarios":"ALTER MATERIALIZED VIEW ... SET PROPERTIES prop = NULL, or any code path calling serializeForUpdate(name, null) for a property that passed the updatable check.","commonSituations":"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.","solutions":["Set the property to an explicit non-null value instead of null.","Drop and recreate the materialized view without the property to get its default.","Remove the null-valued property from the SET PROPERTIES list.","If reset semantics are needed, file/look for a Presto feature request for property clearing."],"exampleFix":"// before\nALTER MATERIALIZED VIEW mv SET PROPERTIES target_max_file_size = NULL;\n// after\nALTER MATERIALIZED VIEW mv SET PROPERTIES target_max_file_size = '1GB';","handlingStrategy":"validation","validationCode":"// Java: ensure the value is non-null before serializeForUpdate\nif (value == null) {\n    throw new IllegalArgumentException(\"Cannot clear MV property \" + name + \"; provide a non-null value\");\n}","typeGuard":"boolean isClearOperation(String name, Object value) {\n    return value == null && MV_ONLY_PROPERTIES_BY_NAME.containsKey(name);\n} // if true, handle via drop/recreate instead of ALTER","tryCatchPattern":"try {\n    serializeForUpdate(name, value);\n} catch (PrestoException e) {\n    if (e.getErrorCode().getCode() == StandardErrorCode.NOT_SUPPORTED.getCode() && value == null) {\n        // fallback: drop + recreate the materialized view without the property\n    } else throw e;\n}","preventionTips":["Never emit SET PROPERTIES with NULL values for Iceberg materialized views.","Filter null diffs out of property-update generators.","To reset, drop and recreate the view with the default.","Document that property clearing is unsupported for this connector."],"tags":["presto","iceberg","materialized-view","null-value"],"backgroundTag":"property-clear-not-supported","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}