Uh oh!
There was an error while loading. Please reload this page.
[SPARK-20380][SQL] Unable to set/unset table comment property using ALTER TABLE SET/UNSET TBLPROPERTIES ddl - #17649
Conversation
sujith71955
commented
Apr 16, 2017
cc @wzhfy |
wzhfy
commented
Apr 16, 2017
test this please |
wzhfy
commented
Apr 16, 2017
also cc @gatorsmile |
wzhfy
commented
Apr 16, 2017
@sujith71955 Can you change the title to be more specific, like "Support altering table comment"? |
There was a problem hiding this comment.
add some comment to explain why this is necessary?
There was a problem hiding this comment.
I will add a comment
gatorsmile
commented
Apr 16, 2017
ok to test |
gatorsmile
commented
Apr 16, 2017
This is a separate issue. Could you open a new JIRA and use a different JIRA number? |
There was a problem hiding this comment.
The basic function has been tested in the other suites. How about changing this test suite to describe-table-after-alter-table?
CREATETABLEtable_comment (a STRING, b INT)
-- ALTER TABLE BY ADDING COMMENTALTERTABLE table_comment set tblproperties(comment ="added comment");
DESC formatted table_comment;
-- ALTER TABLE BY MODIFYING COMMENTALTERTABLE table_comment set tblproperties(comment ="modified comment");
DESC formatted table_comment;
-- DROP TEST TABLEDROPTABLE table_comment;There was a problem hiding this comment.
It sounds we also have a bug in the ALTER TABLE UNSET.
Please also add another test case
-- ALTER TABLE BY UNSETTING COMMENTALTERTABLE table_comment unset tblproperties('comment');There was a problem hiding this comment.
sure, i will add a new jira for this problem and i will update the test suite name as per the suggestion, as you suggested i will also verify ALTER TABLE UNSET .
SparkQA
commented
Apr 16, 2017
Test build #75840 has finished for PR 17649 at commit
|
Any update? ping @sujith71955@wzhfy |
467a694 to
19d80c6Comparesujith71955
commented
Apr 20, 2017
@gatorsmile@wzhfy updated the PR based on the review comments, please let me know for any suggestions. |
SparkQA
commented
Apr 20, 2017
Test build #76002 has finished for PR 17649 at commit
|
SparkQA
commented
Apr 20, 2017
Test build #76004 has finished for PR 17649 at commit
|
There was a problem hiding this comment.
Comment string i.e. "modified comment" is in both Properties and Comment?
There was a problem hiding this comment.
We should remove comment from Properties
There was a problem hiding this comment.
yes, i saw for hive tables already its been taken care in HiveClientImpl.scala class where "comment" is getting filtered from table properties, also for parquet table same has to be taken care.
There was a problem hiding this comment.
I think it would be better to also have other properties with comment in this test.
There was a problem hiding this comment.
rename describe-table-after-alter-table.sql to alter-table-comment.sql?
There was a problem hiding this comment.
nvm I missed your previous discussion
There was a problem hiding this comment.
modified the testcase as per comment, added one more proeprty while altering the table.
wzhfy
commented
Apr 21, 2017
@gatorsmile Should we care about case sensitivity of comment? Hive allows both "comment" and "Comment" in table parameters, while we are extracting comment as a field of |
There was a problem hiding this comment.
Nit:
valcomment=if (propKeys.contains("comment")) Noneelse table.properties.get("comment")gatorsmile
commented
Apr 23, 2017
@wzhfy Could you check the behavior of Hive? |
19d80c6 to
50deed9CompareSparkQA
commented
Apr 23, 2017
Test build #76085 has finished for PR 17649 at commit
|
@gatorsmile Hive treats comment simply as a key in the string-string parameter map, while spark extracts comment from the map as a field in Here's the results of hive: |
50deed9 to
1156483CompareSparkQA
commented
Apr 25, 2017
Test build #76139 has finished for PR 17649 at commit
|
1156483 to
99ba5beCompareSparkQA
commented
Apr 25, 2017
Test build #76142 has finished for PR 17649 at commit
|
sujith71955
commented
Apr 25, 2017
@gatorsmile@wzhfy updated the PR by removing the 'comment' from table properties . |
wzhfy
commented
Apr 26, 2017
The changes look good to me if we don't care about the case sensitivity issue. |
gatorsmile
commented
Apr 26, 2017
@wzhfy In HiveClientImpl.scala, we follow Hive and consider the case sensitivity of property key @sujith71955 Could you resolve the following comment? |
There was a problem hiding this comment.
Nit: How about?
If
commentis in the table property, we reset it to None
There was a problem hiding this comment.
Nit: set tblproperties -> SET TBLPROPERTIES
There was a problem hiding this comment.
Nit: set tblproperties -> SET TBLPROPERTIES
gatorsmile
commented
May 4, 2017
LGTM except a few minor comments. |
…ding/modifying table comment using Alter TableSetPropertiesCommand and UNSET TBLPROPERTIES query. ### What changes were proposed in this pull request? This PR is a follow up PR to JIRA issue 20023 where table comment was not displayed in describe formatted command after user creates a table with table comment. But still was issue when user alter the table properties and adds/updates table comment. table comment which is directly part of CatalogTable instance where not getting updated and old table comment was shown, to handle this issue while updating the table properties map with newly added/modified properties in CatalogTable instance also update the comment parameter with newly added/modified comment as part of AlterTableSetPropertiesCommand which is also now exist in CatalogTable instance level not only in table properties map of CatalogTable instance. this pr has also taken care of unsetting the table comment when user executes AlterTableUnsetPropertiesCommand. ### How was this patch tested? Added test cases as part of SQLQueryTestSuite for verifying table comment using desc formatted table query after adding or modifying table comment as part of AlterTableSetPropertiesCommand and AlterTableUnsetPropertiesCommand.
433ac2b to
4f02adaCompareSparkQA
commented
May 5, 2017
Test build #76496 has finished for PR 17649 at commit
|
sujith71955
commented
May 5, 2017
@wzhfy@gatorsmile fixed all the comments, thanks for reviewing the changes and providing me valuable sharings and comments. thanks. |
@sujith71955 Could you update the PR description and title? This PR is to fix the issue in modify table comments using ALTER TABLE SET/UNSET TBLPROPERTIES, instead of fixing the DESC FORMATTED, right? |
sujith71955
commented
May 6, 2017
@gatorsmile you are right, pr should address the issue which is handled in alter table set/unset properties ddls, updated the description and title, let me know for any clarifications. thanks. |
gatorsmile
commented
May 7, 2017
retest this please |
SparkQA
commented
May 7, 2017
Test build #76551 has finished for PR 17649 at commit
|
gatorsmile
commented
May 8, 2017
Thanks! Merging to master. |
…LTER TABLE SET/UNSET TBLPROPERTIES ddl
### What changes were proposed in this pull request?
Table comment was not getting set/unset using **ALTER TABLE SET/UNSET TBLPROPERTIES** query
eg: ALTER TABLE table_with_comment SET TBLPROPERTIES("comment"= "modified comment)
when user alter the table properties and adds/updates table comment,table comment which is a field of **CatalogTable** instance is not getting updated and old table comment if exists was shown to user, inorder to handle this issue, update the comment field value in **CatalogTable** with the newly added/modified comment along with other table level properties when user executes **ALTER TABLE SET TBLPROPERTIES** query.
This pr has also taken care of unsetting the table comment when user executes query **ALTER TABLE UNSET TBLPROPERTIES** inorder to unset or remove table comment.
eg: ALTER TABLE table_comment UNSET TBLPROPERTIES IF EXISTS ('comment')
### How was this patch tested?
Added test cases as part of **SQLQueryTestSuite** for verifying table comment using desc formatted table query after adding/modifying table comment as part of **AlterTableSetPropertiesCommand** and unsetting the table comment using **AlterTableUnsetPropertiesCommand**.
Author: sujith71955 <sujithchacko.2010@gmail.com>
Closesapache#17649 from sujith71955/alter_table_comment.
What changes were proposed in this pull request?
Table comment was not getting set/unset using ALTER TABLE SET/UNSET TBLPROPERTIES query
eg: ALTER TABLE table_with_comment SET TBLPROPERTIES("comment"= "modified comment)
when user alter the table properties and adds/updates table comment,table comment which is a field of CatalogTable instance is not getting updated and old table comment if exists was shown to user, inorder to handle this issue, update the comment field value in CatalogTable with the newly added/modified comment along with other table level properties when user executes ALTER TABLE SET TBLPROPERTIES query.
This pr has also taken care of unsetting the table comment when user executes query ALTER TABLE UNSET TBLPROPERTIES inorder to unset or remove table comment.
eg: ALTER TABLE table_comment UNSET TBLPROPERTIES IF EXISTS ('comment')
How was this patch tested?
Added test cases as part of SQLQueryTestSuite for verifying table comment using desc formatted table query after adding/modifying table comment as part of AlterTableSetPropertiesCommand and unsetting the table comment using AlterTableUnsetPropertiesCommand.