Added ALTER operations to set and remove table properties#32
Draft
Added ALTER operations to set and remove table properties#32
Conversation
421dd29 to
5a593ee
Compare
rafoid
reviewed
Jul 27, 2023
Comment on lines
+199
to
+209
| * 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"] | ||
| * } |
Collaborator
There was a problem hiding this comment.
I suggest spelling out the operations names:
Suggested change
| * 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(); |
Collaborator
There was a problem hiding this comment.
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(); | |||
Collaborator
There was a problem hiding this comment.
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.
added 3 commits
September 27, 2023 19:04
* Expanded operation names * Conditional commit of updateSchema and updateProperties to avoid empty commit exception
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.
GitHub issue link:
Problem:
Solution:
Testing:
Documentation: