-
Notifications
You must be signed in to change notification settings - Fork 7
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
Added ALTER operations to set and remove table properties #32
base: main
Are you sure you want to change the base?
Conversation
421dd29
to
5a593ee
Compare
* The property changes are expected in the following format: | ||
* SETTING key/value property | ||
* { | ||
* "set_prop":[ | ||
* {"key":"p1","value":"v1"} | ||
* ] | ||
* } | ||
* REMOVING property key | ||
* { | ||
* "rm_prop":["p1","p2"] | ||
* } |
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 suggest spelling out the operations names:
* The property changes are expected in the following format: | |
* SETTING key/value property | |
* { | |
* "set_prop":[ | |
* {"key":"p1","value":"v1"} | |
* ] | |
* } | |
* REMOVING property key | |
* { | |
* "rm_prop":["p1","p2"] | |
* } | |
* The property changes are expected in the following format: | |
* SETTING key/value property | |
* { | |
* "set_property":[ | |
* {"key":"p1","value":"v1"} | |
* ] | |
* } | |
* REMOVING property key | |
* { | |
* "remove_property":["p1","p2"] | |
* } |
// no properties to remove, move on | ||
} | ||
|
||
updateProperties.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.
Commit should be after your check of whether we altered anything. Otherwise, if some other operations were specified (or mistyped) you might get an exception that nothing was really committed.
@@ -279,6 +288,51 @@ public boolean alterTable(String newSchema) throws Exception { | |||
|
|||
// all good - commit changes | |||
updateSchema.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.
Can we update table properties within the same ALTER as schema update? If yes, this commit should go below the if (op == OP_NONE)
check. Also if yes, check for DROP explicitly as above.
* Expanded operation names * Conditional commit of updateSchema and updateProperties to avoid empty commit exception
GitHub issue link:
Problem:
Solution:
Testing:
Documentation: