dongjoon-hyun commented on a change in pull request #24749: [SPARK-27890][SQL] 
Improve SQL parser error message for identifier with hyphens
URL: https://github.com/apache/spark/pull/24749#discussion_r290055158
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala
 ##########
 @@ -1386,7 +1387,7 @@ class AstBuilder(conf: SQLConf) extends 
SqlBaseBaseVisitor[AnyRef] with Logging
    * Create a function database (optional) and name pair.
    */
   protected def visitFunctionName(ctx: QualifiedNameContext): 
FunctionIdentifier = {
-    ctx.identifier().asScala.map(_.getText) match {
+    ctx.identifier.asScala.map(_.getText) match {
 
 Review comment:
   For completeness, could you handle this case, too? @yeshengm 
   ```scala
   scala> sql("drop function if exists max-a").show
   org.apache.spark.sql.catalyst.parser.ParseException:
   mismatched input '-' expecting {<EOF>, '.'}(line 1, pos 27)
   
   == SQL ==
   drop function if exists max-a
   ---------------------------^^^
   ```

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

Reply via email to