You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ct...@apache.org on 2016/07/10 02:37:10 UTC
hive git commit: HIVE-14173: NPE was thrown after enabling directsql
in the middle of session (Chaoyu Tang, reviewed by Sergey Shelukhin)
Repository: hive
Updated Branches:
refs/heads/master fad946bb2 -> 82b84ac76
HIVE-14173: NPE was thrown after enabling directsql in the middle of session (Chaoyu Tang, reviewed by Sergey Shelukhin)
Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/82b84ac7
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/82b84ac7
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/82b84ac7
Branch: refs/heads/master
Commit: 82b84ac766f54c72a76d5e7fe8fd4fe67d264fe7
Parents: fad946b
Author: ctang <ct...@cloudera.com>
Authored: Sat Jul 9 22:36:56 2016 -0400
Committer: ctang <ct...@cloudera.com>
Committed: Sat Jul 9 22:36:56 2016 -0400
----------------------------------------------------------------------
.../src/java/org/apache/hadoop/hive/metastore/ObjectStore.java | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hive/blob/82b84ac7/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java
----------------------------------------------------------------------
diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java b/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java
index 718fa3b..82de857 100644
--- a/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java
+++ b/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java
@@ -2661,6 +2661,10 @@ public class ObjectStore implements RawStore, Configurable {
// the fallback from failed SQL to JDO is not possible.
boolean isConfigEnabled = HiveConf.getBoolVar(getConf(), ConfVars.METASTORE_TRY_DIRECT_SQL)
&& (HiveConf.getBoolVar(getConf(), ConfVars.METASTORE_TRY_DIRECT_SQL_DDL) || !isInTxn);
+ if (isConfigEnabled && directSql == null) {
+ directSql = new MetaStoreDirectSql(pm, getConf());
+ }
+
if (!allowJdo && isConfigEnabled && !directSql.isCompatibleDatastore()) {
throw new MetaException("SQL is not operational"); // test path; SQL is enabled and broken.
}