This is an automated email from the ASF dual-hosted git repository.

gates pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new 28f8a93  HIVE-22102 Reduce HMS call when creating HiveSession (Rajesh 
Balamohan via Alan Gates)
28f8a93 is described below

commit 28f8a93c11e0b68c0d36acfbaf51c5abded1bb03
Author: Alan Gates <alanfga...@gmail.com>
AuthorDate: Thu Aug 29 15:19:04 2019 -0700

    HIVE-22102 Reduce HMS call when creating HiveSession (Rajesh Balamohan via 
Alan Gates)
---
 .../java/org/apache/hive/service/cli/session/HiveSessionImpl.java    | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/service/src/java/org/apache/hive/service/cli/session/HiveSessionImpl.java 
b/service/src/java/org/apache/hive/service/cli/session/HiveSessionImpl.java
index a8bf876..a0e27c9 100644
--- a/service/src/java/org/apache/hive/service/cli/session/HiveSessionImpl.java
+++ b/service/src/java/org/apache/hive/service/cli/session/HiveSessionImpl.java
@@ -82,6 +82,8 @@ import org.slf4j.LoggerFactory;
 
 import com.google.common.collect.Lists;
 
+import static org.apache.hadoop.hive.metastore.Warehouse.DEFAULT_DATABASE_NAME;
+
 /**
  * HiveSession
  *
@@ -311,7 +313,8 @@ public class HiveSessionImpl implements HiveSession {
         }
       } else if (key.startsWith("use:")) {
         try {
-          if (sessionHive.getDatabase(entry.getValue()) == null) {
+          if (!(StringUtils.equals(DEFAULT_DATABASE_NAME, entry.getValue()))
+              && sessionHive.getDatabase(entry.getValue()) == null) {
             throw new HiveSQLException("Database " + entry.getValue() + " does 
not exist");
           }
         } catch (HiveException e) {

Reply via email to