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

    https://github.com/apache/spark/pull/12424#discussion_r59936989
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/command/commands.scala 
---
    @@ -528,3 +530,20 @@ case class SetDatabaseCommand(databaseName: String) 
extends RunnableCommand {
     
       override val output: Seq[Attribute] = Seq.empty
     }
    +
    +
    +/**
    + * Returns the current database of metadataHive.
    + */
    +@ExpressionDescription(
    +  usage = "_FUNC_() - Returns the current database.",
    +  extended = "> SELECT _FUNC_()")
    +private[sql] case class CurrentDatabase(ctx: SQLContext)
    --- End diff --
    
    i'm afraid this is too convoluted -- why don't we just have this function 
doesn't take any arguments, and then in the optimizer (which should take a 
SessionState) replace it with a literal? similar to how we compute CurrentDate.


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