Skip to content

Support drop materialized view#15590

Closed
gggrace14 wants to merge 4 commits intoprestodb:masterfrom
gggrace14:dveb
Closed

Support drop materialized view#15590
gggrace14 wants to merge 4 commits intoprestodb:masterfrom
gggrace14:dveb

Conversation

@gggrace14
Copy link
Copy Markdown
Contributor

This depends on #15589

Drop materialized view works as dropping a standard table, plus removing the MV name from the list of dependent MVs saved in all base table metadata.

Copy link
Copy Markdown

@highker highker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed offline, please re-request my review once the first two commits are fixed

@gggrace14 gggrace14 force-pushed the dveb branch 2 times, most recently from a4c9ad7 to fa63fc1 Compare January 16, 2021 00:16
Add createMaterializedView API to MetadataManager and add CreateMaterializedViewTask
that calls the API to perform MV creation.

HiveMetadata implementation of the API is to add essential MV table parameters
and create MV as a standard table. ConnectorMaterializedViewDefinition is the json
structure that contains all essential metadata we need to keep in Metastore. It will
serialize into a table parameter.

By this diff, querying MV works the same as querying a standard table. We only allow
query/select on MV and disallow all other statements, ex. create, insert, delete,
which is enforced in StatementAnalyzer.

We don't support MVs defined across different catalogs, which is enforced in
CreateMaterializedViewTask
Keep a list of dependency materialized view names as a table parameter
of every base table. When a new MV is created, append its name to the lists.

Add MV partition validation to HiveMetastore. At the moment, we only support
partitioned MV defined on partitioned base tables. And MV must have one partition
directly matched (selected) from every base table.

Add and implement updateTableParameters API in SemiTransactionalHiveMetastore.
It only updates table parameters and will not touch table location, stats, etc.

Add updateTableParameters API to ExtendedHiveMetastore and subclasses,
which calls alterTable() that is already implemented.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants