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

    https://github.com/apache/spark/pull/12183#discussion_r58631403
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala
 ---
    @@ -474,15 +479,8 @@ class SessionCatalog(
           // This function exists in the FunctionRegistry.
           true
         } else {
    -      // Need to check if this function exists in the metastore.
    -      try {
    -        // TODO: It's better to ask external catalog if this function 
exists.
    -        // So, we can avoid of having this hacky try/catch block.
    -        getFunction(name) != null
    -      } catch {
    -        case _: NoSuchFunctionException => false
    -        case _: AnalysisException => false // HiveExternalCatalog wraps 
all exceptions with it.
    -      }
    +      val db = name.database.getOrElse(currentDb)
    +      externalCatalog.listFunctions(db,name.unquotedString).size > 0
    --- End diff --
    
    No, the right thing to do here is to implement `functionExists` in the 
external catalog and `HiveClientImpl`. That's what the TODO meant.


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