dtenedor commented on a change in pull request #35855:
URL: https://github.com/apache/spark/pull/35855#discussion_r832424326
##########
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:
:) I tried this, but it turns out that `getText` strips the spaces. Thus
this comment:
```
// Extract the raw expression text so that we can save the user provided
text. We don't
// use `Expression.sql` to avoid storing incorrect text caused by bugs
in any expression's
// `sql` method. Note: `exprCtx.getText` returns a string without
spaces, so we need to
// get the text from the underlying char stream instead.
```
--
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]