saihemanth-cloudera commented on code in PR #3799:
URL: https://github.com/apache/hive/pull/3799#discussion_r1029644007


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/DatabaseProduct.java:
##########
@@ -93,10 +100,6 @@ public static DatabaseProduct 
determineDatabaseProduct(String productName,
 
       // Check for null again in case of race condition
       if (theDatabaseProduct == null) {
-        Preconditions.checkNotNull(conf, "Configuration is null");

Review Comment:
   Shouldn't we check this for race conditions/concurrent connections? 



##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/DatabaseProduct.java:
##########
@@ -77,8 +77,15 @@ public static DatabaseProduct 
determineDatabaseProduct(String productName,
       Configuration conf) {
     DbType dbt;
 
+    // Check if we are using an external database product
+    boolean isExternal = MetastoreConf.getBoolVar(conf, 
ConfVars.USE_CUSTOM_RDBMS);
+
     if (theDatabaseProduct != null) {
-      Preconditions.checkState(theDatabaseProduct.dbType == 
getDbType(productName));
+      dbt = getDbType(productName);
+      if (isExternal) {
+        dbt = DbType.CUSTOM;
+      }
+      Preconditions.checkState(theDatabaseProduct.dbType == dbt);

Review Comment:
   I wonder this 
[test](https://github.com/apache/hive/blob/master/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/txn/TestTxnUtils.java#L262)
 would fail after this change.



-- 
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.

To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to