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

    https://github.com/apache/spark/pull/4995#discussion_r27191997
  
    --- Diff: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/sqlUDFCurrentDB.scala ---
    @@ -0,0 +1,18 @@
    +package org.apache.spark.sql.hive
    +
    +import org.apache.hadoop.hive.ql.udf.generic.UDFCurrentDB
    +import org.apache.hadoop.hive.ql.exec.Description
    +import org.apache.hadoop.hive.ql.udf.generic.GenericUDF.DeferredObject
    +import org.apache.hadoop.hive.ql.session.SessionState
    +
    +// deterministic in the query range
    +@Description(name = "current_database",
    +    value = "_FUNC_() - returns currently using database name")
    +class sqlUDFCurrentDB extends UDFCurrentDB {
    +
    +  // This function just throws an exception in hive0.13
    +  override def evaluate(arguments: Array[DeferredObject]): Object = {
    +    SessionState.get().getCurrentDatabase()
    --- End diff --
    
    Does this actually work in the distributed mode?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to