Github user dongjoon-hyun commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20565#discussion_r167411254
  
    --- Diff: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala 
---
    @@ -292,10 +292,12 @@ private[hive] class HiveClientImpl(
       }
     
       override def setCurrentDatabase(databaseName: String): Unit = 
withHiveState {
    -    if (databaseExists(databaseName)) {
    -      state.setCurrentDatabase(databaseName)
    -    } else {
    -      throw new NoSuchDatabaseException(databaseName)
    +    if (state.getCurrentDatabase != databaseName) {
    +      if (databaseExists(databaseName)) {
    --- End diff --
    
    This PR uses an additional `getCurrentDatabase` to avoid `databaseExists`. 
Can we have a more specific in the title?


---

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

Reply via email to