cloud-fan commented on code in PR #42888:
URL: https://github.com/apache/spark/pull/42888#discussion_r1350581789


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala:
##########
@@ -2274,19 +2267,32 @@ class AstBuilder extends DataTypeAstBuilder with 
SQLConfHelper with Logging {
     val filter = Option(ctx.where).map(expression(_))
     val ignoreNulls =
       Option(ctx.nullsOption).map(_.getType == 
SqlBaseParser.IGNORE).getOrElse(false)
-    val funcCtx = ctx.functionName
-    val func = withFuncIdentClause(
-      funcCtx,
-      ident => UnresolvedFunction(ident, arguments, isDistinct, filter, 
ignoreNulls)
-    )
 
-    // Check if the function is evaluated in a windowed context.
-    ctx.windowSpec match {
-      case spec: WindowRefContext =>
-        UnresolvedWindowExpression(func, visitWindowRef(spec))
-      case spec: WindowDefContext =>
-        WindowExpression(func, visitWindowDef(spec))
-      case _ => func
+    // Is this an IDENTIFIER clause instead of a function call?
+    if (name.toLowerCase(Locale.ROOT) == "identifier" && // IDENTIFIER (but 
not `IDENTIFIER`)

Review Comment:
   in order to check this more explicitly, shall we update the parser rule a 
bit? `functionName LEFT_PAREN ...` -> `(IDENTIFIER_KW | functionName) 
LEFT_PAREN`



-- 
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]

Reply via email to