-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-21119][SQL] unset table properties should keep the table comment #18325
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
Conversation
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.
Does this work for Hive table? When CatalogTable's comment is None, we will ignore it when converting it to Hive table metadata. So seems it will not be unset?
spark/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala
Line 935 in 9d0db5a
| table.comment.foreach { c => hiveTable.setProperty("comment", c) } |
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.
Oh. I see. It goes to override the original table metadata if no comment is set.
|
LGTM |
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.
In above code not shown in this diff, we check if a prop key exists in table.properties or not when ifExists is false. As comment is not in table.properties, I think it will cause AnalysisException when unset comment?
|
Test build #78162 has finished for PR 18325 at commit
|
|
Test build #78180 has finished for PR 18325 at commit
|
|
LGTM |
|
Thanks! Merging to master. |
What changes were proposed in this pull request?
Previous code mistakenly use
table.properties.get("comment")to read the existing table comment, we should usetable.commentHow was this patch tested?
new regression test