gengliangwang commented on a change in pull request #35855:
URL: https://github.com/apache/spark/pull/35855#discussion_r832316164
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala
##########
@@ -2781,13 +2782,18 @@ class AstBuilder extends
SqlBaseParserBaseVisitor[AnyRef] with SQLConfHelper wit
Option(commentSpec()).map(visitCommentSpec).foreach {
builder.putString("comment", _)
}
+ // Add the 'DEFAULT expression' clause in the column definition, if any,
to the column metadata.
+ Option(ctx.defaultExpression()).map(visitDefaultExpression).foreach {
field =>
Review comment:
nit: We don't need function visitDefaultExpression. We can define a
variable in the grammar file like
```
defaultExpression
: DEFAULT defaultValue=expression
```
and then we can have
```
Option(ctx.defaultExpression()).map(_.defaultValue.getText)
```
here
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]