Uh oh!
There was an error while loading. Please reload this page.
[SPARK-21112] [SQL] ALTER TABLE SET TBLPROPERTIES should not overwrite COMMENT - #18318
[SPARK-21112] [SQL] ALTER TABLE SET TBLPROPERTIES should not overwrite COMMENT#18318gatorsmile wants to merge 1 commit into
Conversation
gatorsmile
commented
Jun 15, 2017
| val newTable = table.copy( | ||
| properties = table.properties ++ properties, | ||
| comment = properties.get("comment")) | ||
| comment = properties.get("comment").orElse(table.comment)) |
There was a problem hiding this comment.
What about UNSET TBLPROPERTIES command?
There was a problem hiding this comment.
This looks fine. However, when setting properties for Hive table, a None comment will be ignored and won't override the comment.
We don't do similar thing in InMemoryCatalog and just override it with the None comment.
Not sure if we should fix it here or in InMemoryCatalog.
There was a problem hiding this comment.
Could you show an example?
There was a problem hiding this comment.
alter table src set tblproperties ('foo' = 'bar', 'comment' = 'table_comment');
alter table src unset tblproperties ('foo');
we will lost comment in this case.
SparkQA
commented
Jun 16, 2017
Test build #78123 has finished for PR 18318 at commit
|
cloud-fan
commented
Jun 16, 2017
LGTM, merging to master! |
cloud-fan
commented
Jun 16, 2017
is it also a problem for other branches? |
gatorsmile
commented
Jun 16, 2017
Only the master branch has such an issue. Thanks! |
… COMMENT ### What changes were proposed in this pull request? `ALTER TABLE SET TBLPROPERTIES` should not overwrite `COMMENT` even if the input property does not have the property of `COMMENT`. This PR is to fix the issue. ### How was this patch tested? Covered by the existing tests. Author: Xiao Li <gatorsmile@gmail.com> Closesapache#18318 from gatorsmile/fixTableComment.
What changes were proposed in this pull request?
ALTER TABLE SET TBLPROPERTIESshould not overwriteCOMMENTeven if the input property does not have the property ofCOMMENT. This PR is to fix the issue.How was this patch tested?
Covered by the existing tests.