-
- Downloads
[SPARK-20380][SQL] Unable to set/unset table comment property using ALTER...
[SPARK-20380][SQL] Unable to set/unset table comment property using ALTER 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> Closes #17649 from sujith71955/alter_table_comment.
Showing
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/InMemoryCatalog.scala 5 additions, 3 deletions...g/apache/spark/sql/catalyst/catalog/InMemoryCatalog.scala
- sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala 9 additions, 3 deletions...in/scala/org/apache/spark/sql/execution/command/ddl.scala
- sql/core/src/test/resources/sql-tests/inputs/describe-table-after-alter-table.sql 29 additions, 0 deletions...ces/sql-tests/inputs/describe-table-after-alter-table.sql
- sql/core/src/test/resources/sql-tests/results/describe-table-after-alter-table.sql.out 161 additions, 0 deletions...ql-tests/results/describe-table-after-alter-table.sql.out
Loading
Please register or sign in to comment