-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Add ALTER TABLE SET PROPERTIES statement #21495
Add ALTER TABLE SET PROPERTIES statement #21495
Conversation
Codenotify: Notifying subscribers in CODENOTIFY files for diff ba2f731...4f826af.
|
single commit per PR and Can you update with [WIP] or draft if few changes are yet to be done. I wanted to understand how existing properties are going to handled, can we add random values to existing properties? and also if we have alter table set properties, why not having alter schema/database and also as its taking random key = value wat value its adding and use case to it. |
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! (docs)
f1bc667
to
a4332d9
Compare
a4332d9
to
787eb0b
Compare
There are 2 separate cherry-picks which serve different purposes, hence 2 different commits. |
577174d
to
4d21e4b
Compare
This is ready for review now @yingsu00 @imjalpreet @agrawalreetika |
4d21e4b
to
0efcfd1
Compare
After the recent push, build is failing. Working on this. |
4d92356
to
f1bd1d4
Compare
This is ready to be reviewed. |
presto-base-jdbc/src/main/java/com/facebook/presto/plugin/jdbc/JdbcClient.java
Outdated
Show resolved
Hide resolved
Map<String, Expression> sqlPropertyValues, | ||
Session session, | ||
Metadata metadata, | ||
Map<NodeRef<Parameter>, Expression> parameters) |
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.
I see the boolean parameter setDefaultProperties
missed here, which was introduced in trino commit?
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.
I did not understand the use case of introducing that parameter, and hence skipped it.
ClickHouseTableHandle tableHandle = (ClickHouseTableHandle) table; | ||
clickHouseClient.setTableProperties(ClickHouseIdentity.from(session), tableHandle, properties); | ||
} | ||
|
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.
Add Override
annotation here.
Can we add some tests to test the feature support in the connector?
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.
Clickhouse server is spawned using docker in presto tests. I skipped the test on purpose as I am not sure how do I test it. cc @yingsu00
@pratyakshsharma Should we include |
235c533
to
3853b50
Compare
The test failures are related to the code changes from #21250. Once it gets merged into master, the failures should resolve |
3853b50
to
dbabd11
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! (docs)
New review prompted by changes to https://github.com/prestodb/presto/blob/master/presto-docs/src/main/sphinx/sql/alter-table.rst. Pulled branch, new local build of docs, looks good. Thanks!
I see clickhouse tests are disabled in the pom.xml here - presto/presto-clickhouse/pom.xml Line 248 in 7d19516
So should I still proceed with adding the clickhouse tests in this PR? @agrawalreetika @yingsu00 As per this comment - #21894 (comment), it looks like the existing tests are failing as well |
5517bd7
to
7b234e9
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! (docs)
Pull branch, local doc build. Thanks!
Nit to add PR number to release note entry.
|
@yingsu00 this is good to take a pass. |
presto-iceberg/src/test/java/com/facebook/presto/iceberg/IcebergDistributedSmokeTestBase.java
Show resolved
Hide resolved
presto-main/src/main/java/com/facebook/presto/metadata/MetadataUtil.java
Show resolved
Hide resolved
338b6ea
to
d200ddc
Compare
Updated release notes, thank you @steveburnett |
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.
Overall looks good to me.
Left few commetns around adding tests, please check
presto-parser/src/test/java/com/facebook/presto/sql/parser/TestSqlParser.java
Show resolved
Hide resolved
presto-parser/src/test/java/com/facebook/presto/sql/parser/TestStatementBuilder.java
Show resolved
Hide resolved
d200ddc
to
b7734dd
Compare
b7734dd
to
76687fe
Compare
@agrawalreetika @yingsu00 this is good for another pass |
0831752
to
deaa9e8
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
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.
Thanks for this work, overall looks good to me! Some nits and little things.
presto-main/src/main/java/com/facebook/presto/execution/SetPropertiesTask.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/com/facebook/presto/execution/SetPropertiesTask.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/com/facebook/presto/execution/RenameTableTask.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/com/facebook/presto/hive/security/SqlStandardAccessControl.java
Show resolved
Hide resolved
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.
Mostly nits. Otherwise LGTM. One question though - is there any way to "unset" a table property through this in order to take up the default value instead? Or would a user have to manually look up the default value and set it?
presto-main/src/main/java/com/facebook/presto/execution/SetPropertiesTask.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/com/facebook/presto/execution/SetSessionTask.java
Outdated
Show resolved
Hide resolved
presto-parser/src/main/java/com/facebook/presto/sql/parser/AstBuilder.java
Outdated
Show resolved
Hide resolved
presto-parser/src/main/java/com/facebook/presto/sql/SqlFormatter.java
Outdated
Show resolved
Hide resolved
@ZacBlanco Currently there is no way to unset other than setting the default value manually. |
Cherry-pick of trinodb/trino@72df2b9 Co-authored-by: ebyhr
deaa9e8
to
4f826af
Compare
@hantangwangd @ZacBlanco @yingsu00 this is good for another pass. |
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.
Thanks for the fix, lgtm!
Cherry-pick of trinodb/trino#9401
Co-authored-by: ebyhr
Motivation and Context
Setting table properties can help in modifying critical table properties such as the one which controls concurrency behaviour for an iceberg table.
Impact
ALTER TABLE ... SET PROPERTIES
Test Plan
Manual testing
Unit testing
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.