feat(plugin-iceberg): Add ALTER MATERIALIZED VIEW SET PROPERTIES#27806
Draft
tdcmeehan wants to merge 1 commit into
Draft
feat(plugin-iceberg): Add ALTER MATERIALIZED VIEW SET PROPERTIES#27806tdcmeehan wants to merge 1 commit into
ALTER MATERIALIZED VIEW SET PROPERTIES#27806tdcmeehan wants to merge 1 commit into
Conversation
Contributor
Reviewer's GuideAdds end-to-end support for ALTER MATERIALIZED VIEW ... SET PROPERTIES for Iceberg materialized views, including parser/AST support, metadata wiring, Iceberg connector implementation, property serialization, access control, and tests for behavior and failure modes. Sequence diagram for ALTER MATERIALIZED VIEW SET PROPERTIES flowsequenceDiagram
actor Client
participant Parser as AstBuilder
participant Task as SetPropertiesTask
participant MetaMgr as MetadataManager
participant ConnMeta as IcebergAbstractMetadata
participant MVProps as IcebergMaterializedViewProperties
Client->>Parser: visitSetMaterializedViewProperties()
Parser-->>Client: SetProperties(MATERIALIZED_VIEW)
Client->>Task: execute(SetProperties)
Task->>Task: SystemSessionProperties.isLegacyMaterializedViews()
Task->>MetaMgr: getMaterializedViewPropertyManager().getUserSpecifiedProperties()
Task->>Task: setMaterializedViewProperties()
Task->>MetaMgr: setMaterializedViewProperties(Session, QualifiedObjectName, Map)
MetaMgr->>ConnMeta: setMaterializedViewProperties(ConnectorSession, SchemaTableName, Map)
ConnMeta->>ConnMeta: getMaterializedView()
ConnMeta->>MVProps: serializeForUpdate(name, value)
MVProps-->>ConnMeta: Map.Entry(storageKey, serializedValue)
ConnMeta->>ConnMeta: updateIcebergViewProperties(ConnectorSession, SchemaTableName, Map)
ConnMeta-->>MetaMgr: properties updated
MetaMgr-->>Task: done
Task-->>Client: ALTER MATERIALIZED VIEW completed
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a new SQL statement,
ALTER MATERIALIZED VIEW <name> SET PROPERTIES (...), and implements it for the Iceberg connector. Lets users updatestale_read_behavior,staleness_window, andrefresh_typeon existing Iceberg materialized views.storage_schemaandstorage_tableremain creation-only since they identify the physical storage table.NULLvalues are rejected (no clearing).The statement is gated at the engine on
legacy_materialized_views=false; legacy mode is rejected before any connector dispatch, preserving prior behavior.Motivation and Context
Today an Iceberg materialized view's freshness/refresh policy is fixed at creation. Changing it requires dropping and recreating the MV — which also drops the storage table and any cached data. This PR makes those policy properties tunable in place.
Impact
New SQL surface:
ALTER MATERIALIZED VIEW name SET PROPERTIES (...).Connector SPI gains
ConnectorMetadata.setMaterializedViewProperties(ConnectorSession, SchemaTableName, Map<String, Object>)with a default that throwsNOT_SUPPORTED. Existing connectors are unaffected.Plumbing mirrors
ALTER TABLE ... SET PROPERTIES:SetProperties.TypegainsMATERIALIZED_VIEW, and the engineMetadatafacade /MetadataManager/ its wrappers expose the new method. Access control reusescheckCanSetTablePropertiesagainst the MV name.Test Plan
TestSqlParser#testSetPropertiescovers parsing of the new statement (positive andIF EXISTScases).TestIcebergMaterializedViewMetadataadds four integration tests: golden-path update, rejection ofstorage_schema/storage_table, legacy-mode rejection, and missing-MV behavior with/withoutIF EXISTS.Contributor checklist
Release Notes