Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13706#discussion_r118989143
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala
 ---
    @@ -1090,6 +1090,24 @@ class SessionCatalog(
         }
       }
     
    +  /** Create a temporary macro. */
    +  def createTempMacro(
    +      name: String,
    +      info: ExpressionInfo,
    +      functionBuilder: FunctionBuilder): Unit = {
    +    if (functionRegistry.functionExists(name)) {
    --- End diff --
    
    ```
    hive> create temporary macro max(x int)
        > x*x;
    OK
    Time taken: 0.014 seconds
    
    hive> select max(3) from t1;
    OK
    9
    Time taken: 0.468 seconds, Fetched: 1 row(s)
    
    hive> select max(3,4) from t1;
    FAILED: SemanticException [Error 10015]: Line 1:7 Arguments length mismatch 
'4': The macro max accepts exactly 1 arguments.
    ```
    
    Hive overwrites the temporary function



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to