wangyum commented on a change in pull request #24566: [SPARK-27667][SQL]get the
current database from spark catalog instead of querying the Hive
URL: https://github.com/apache/spark/pull/24566#discussion_r283253411
##########
File path:
sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala
##########
@@ -250,9 +250,14 @@ private[hive] object SparkSQLCLIDriver extends Logging {
var ret = 0
var prefix = ""
- val currentDB = ReflectionUtils.invokeStatic(classOf[CliDriver],
"getFormattedDb",
- classOf[HiveConf] -> conf, classOf[CliSessionState] -> sessionState)
-
+ def currentDB = {
Review comment:
Could we change it to?
```scala
val currentDB = if (HiveConf.getBoolVar(conf,
HiveConf.ConfVars.CLIPRINTCURRENTDB)) {
val currDb =
SparkSQLEnv.sqlContext.sessionState.catalog.getCurrentDatabase
s" ($currDb)"
} else {
""
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]