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

    https://github.com/apache/spark/pull/9576#discussion_r44342939
  
    --- Diff: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala ---
    @@ -455,7 +455,15 @@ class HiveContext private[hive](
       // Note that HiveUDFs will be overridden by functions registered in this 
context.
       @transient
       override protected[sql] lazy val functionRegistry: FunctionRegistry =
    -    new HiveFunctionRegistry(FunctionRegistry.builtin.copy())
    +    new HiveFunctionRegistry(FunctionRegistry.builtin.copy()) {
    +      override def lookupFunction(name: String, children: 
Seq[Expression]): Expression = {
    +        // Hive Registry need current database to lookup function
    +        // TODO: the current database of executionHive should be 
consistent with metadataHive
    +        executionHive.withHiveState {
    +          super.lookupFunction(name, children)
    --- End diff --
    
    Just a note. In `HiveQLDialect`, when we parse a query, we use 
`sqlContext.executionHive.withHiveState`. Right now, `create function` is still 
broken because the metadata of the function is in metadata hive. However, it is 
the work of another PR.


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