You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "melihsozdinler (via GitHub)" <gi...@apache.org> on 2023/08/07 11:34:47 UTC

[GitHub] [spark] melihsozdinler commented on a diff in pull request #42365: [SPARK-44680][SQL] Improve the error for parameters in `DEFAULT`

melihsozdinler commented on code in PR #42365:
URL: https://github.com/apache/spark/pull/42365#discussion_r1285746360


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala:
##########
@@ -3170,15 +3174,15 @@ class AstBuilder extends DataTypeAstBuilder with SQLConfHelper with Logging {
    */
   override def visitDefaultExpression(ctx: DefaultExpressionContext): String =
     withOrigin(ctx) {
-      verifyAndGetExpression(ctx.expression())
+      verifyAndGetExpression(ctx.expression(), "DEFAULT")

Review Comment:
   I think using enums is better for future usage, and the code is more robust against changes with typo problems. And later we can reuse this enum at another place as well, when needed.



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org