-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support ALTER MATERIALIZED VIEW ... SET PROPERTIES ... #9613
Conversation
3557a83
to
cf37d85
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to have high-level test like BaseConnectorTest.testRenameMaterializedView
core/trino-parser/src/main/antlr4/io/trino/sql/parser/SqlBase.g4
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/SetPropertiesTask.java
Outdated
Show resolved
Hide resolved
Please base your PR on top of #9401 |
bd6a521
to
6c268c7
Compare
#9401 has been merged into master and I have rebased this PR onto master. |
c837fbc
to
f495d80
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm % comments
core/trino-parser/src/test/java/io/trino/sql/parser/TestSqlParser.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/SetPropertiesTask.java
Outdated
Show resolved
Hide resolved
30d5126
to
b97ad90
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm % comments
core/trino-main/src/main/java/io/trino/sql/analyzer/StatementAnalyzer.java
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/CreateMaterializedViewTask.java
Outdated
Show resolved
Hide resolved
36331ed
to
61b8681
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some problems with the existing ALTER TABLE ... SET PROPERTIES
that need to be resolved, so we need to hold off on this until that is done.
61b8681
to
bdfdfec
Compare
@electrum what problems do you mean? |
77ff9f3
to
f6b9ad6
Compare
1d1a6ba
to
cd3beca
Compare
05d60cf
to
6afac02
Compare
ae56504
to
848b17a
Compare
848b17a
to
c81a4ea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm % comments. @martint do you want to look?
core/trino-main/src/main/java/io/trino/metadata/AbstractCatalogPropertyManager.java
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/metadata/AbstractPropertyManager.java
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/metadata/AbstractPropertyManager.java
Show resolved
Hide resolved
d9f41af
to
4810808
Compare
f0db549
to
34bed1f
Compare
This commit implements ALTER MATERIALIZED VIEW ... SET PROPERTIES... in the core engine. The implementation supports the use of a newly introduced SQL keyword "DEFAULT" on the right hand side of a property assignment. The support of the DEFAULT keyword is implemented by modifying certain classes related to properties in general (i.e. they are not specific to materialized view). Consequently, several other SQL statements also gain the support of the DEFAULT keyword "for free". They are: ALTER TABLE... ADD COLUMN... ANALYZE CREATE MATERIALIZED VIEW CREATE SCHEMA CREATE TABLE (both column properties and table properties) CREATE TABLE AS Note, however, that ALTER TABLE ... SET PROPERTIES ... is not in the list above. Support for DEFAULT in ALTER TABLE...SET PROPERTIES... requires extensive changes and will therefore be implemented in a subsequent commit.
There are two versions of AccessControl.checkCanCreateTable: the old deprecated version and the newer version which takes an additional Map<String, Object> parameter "properties"(so that the properties can be taken into account when making an access control decision). Which version is to be used should depend solely on the FeatureConfig parameter "disableSetPropertiesSecurityCheckForCreateDdl" - it should not depend on whether the "properties" parameter is empty.
34bed1f
to
842d8b2
Compare
This PR implements support for the ALTER MATERIALIZED VIEW ... SET PROPERTIES ... statement