You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/10/16 07:26:40 UTC

[GitHub] [spark] AngersZhuuuu commented on a change in pull request #26053: [SPARK-29379][SQL]SHOW FUNCTIONS show '!=', '<>' , 'between', 'case'

AngersZhuuuu commented on a change in pull request #26053: [SPARK-29379][SQL]SHOW FUNCTIONS  show '!=', '<>' , 'between', 'case'
URL: https://github.com/apache/spark/pull/26053#discussion_r335314222
 
 

 ##########
 File path: sql/core/src/main/scala/org/apache/spark/sql/execution/command/functions.scala
 ##########
 @@ -73,6 +73,11 @@ case class CreateFunctionCommand(
       s"is not allowed: '${databaseName.get}'")
   }
 
+  // Redefine a virtual function is not allowed
+  if (FunctionsCommand.virtualOperators.contains(functionName.toLowerCase(Locale.ROOT))) {
+    throw new AnalysisException(s"It's not allowed to redefine virtual function '$functionName'")
 
 Review comment:
   > what's the error message if users try to redefine `=`?
   
   can't use `create function = ....`, since `=` is a reserved key, we should use 
   ```
   create function `=` ....
   ```
   
   Error message:
   ```
   org.apache.hadoop.hive.ql.metadata.HiveException: InvalidObjectException(message:= is not a valid object name);
   org.apache.hadoop.hive.ql.metadata.HiveException: InvalidObjectException(message:> is not a valid object name);
   org.apache.hadoop.hive.ql.metadata.HiveException: InvalidObjectException(message:!= is not a valid object name);
   
   but `case` `between` can be registered.
   ```
   
   as @HyukjinKwon  methoned, we should fix this ambiguity between functions and operators at the end.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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