hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From khorg...@apache.org
Subject hive git commit: HIVE-11023 : Disable directSQL if datanucleus.identifierFactory = datanucleus2 (Sushanth Sowmyan, reviewed by Ashutosh Chauhan)
Date Wed, 17 Jun 2015 23:41:27 GMT
Repository: hive
Updated Branches:
  refs/heads/branch-1 cae46469b -> 9b1019491


HIVE-11023 : Disable directSQL if datanucleus.identifierFactory = datanucleus2 (Sushanth Sowmyan,
reviewed by Ashutosh Chauhan)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/9b101949
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/9b101949
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/9b101949

Branch: refs/heads/branch-1
Commit: 9b10194912f77f627e0e66a9480f8fbe43fe3809
Parents: cae4646
Author: Sushanth Sowmyan <khorgath@gmail.com>
Authored: Wed Jun 17 16:34:07 2015 -0700
Committer: Sushanth Sowmyan <khorgath@gmail.com>
Committed: Wed Jun 17 16:39:47 2015 -0700

----------------------------------------------------------------------
 .../hadoop/hive/metastore/MetaStoreDirectSql.java     | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/9b101949/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java
----------------------------------------------------------------------
diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java b/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java
index ed810d2..1c21c8b 100644
--- a/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java
+++ b/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java
@@ -128,10 +128,18 @@ class MetaStoreDirectSql {
     convertMapNullsToEmptyStrings =
         HiveConf.getBoolVar(conf, ConfVars.METASTORE_ORM_RETRIEVE_MAPNULLS_AS_EMPTY_STRINGS);
 
-    this.isCompatibleDatastore = ensureDbInit() && runTestQuery();
-    if (isCompatibleDatastore) {
-      LOG.info("Using direct SQL, underlying DB is " + dbType);
+    String jdoIdFactory = HiveConf.getVar(conf, ConfVars.METASTORE_IDENTIFIER_FACTORY);
+    if (! ("datanucleus1".equalsIgnoreCase(jdoIdFactory))){
+      LOG.warn("Underlying metastore does not use 'datanuclues1' for its ORM naming scheme."
+          + " Disabling directSQL as it uses hand-hardcoded SQL with that assumption.");
+      isCompatibleDatastore = false;
+    } else {
+      isCompatibleDatastore = ensureDbInit() && runTestQuery();
+      if (isCompatibleDatastore) {
+        LOG.info("Using direct SQL, underlying DB is " + dbType);
+      }
     }
+
     isAggregateStatsCacheEnabled = HiveConf.getBoolVar(conf, ConfVars.METASTORE_AGGREGATE_STATS_CACHE_ENABLED);
     if (isAggregateStatsCacheEnabled) {
       aggrStatsCache = AggregateStatsCache.getInstance(conf);


Mime
View raw message