yaooqinn commented on a change in pull request #26847: [SPARK-30214][SQL]
Support COMMENT ON syntax
URL: https://github.com/apache/spark/pull/26847#discussion_r360307051
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala
##########
@@ -3410,4 +3410,22 @@ class AstBuilder(conf: SQLConf) extends
SqlBaseBaseVisitor[AnyRef] with Logging
ctx.EXISTS != null,
ctx.TEMPORARY != null)
}
+
+ override def visitCommentNamespace(ctx: CommentNamespaceContext):
LogicalPlan = withOrigin(ctx) {
+ val comment = ctx.commennt.getType match {
+ case SqlBaseParser.NULL => ""
Review comment:
I have checked the Postgres source code `NULL` and empty string are the
same,
```c
/*
* CreateComments --
*
* Create a comment for the specified object descriptor. Inserts a new
* pg_description tuple, or replaces an existing one with the same key.
*
* If the comment given is null or an empty string, instead delete any
* existing comment for the specified key.
*/
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]