[
https://issues.apache.org/jira/browse/HIVE-24120?focusedWorklogId=486510&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-486510
]
ASF GitHub Bot logged work on HIVE-24120:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 19/Sep/20 14:36
Start Date: 19/Sep/20 14:36
Worklog Time Spent: 10m
Work Description: gatorblue commented on a change in pull request #1470:
URL: https://github.com/apache/hive/pull/1470#discussion_r491458207
##########
File path:
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/DatabaseProduct.java
##########
@@ -20,71 +20,646 @@
import java.sql.SQLException;
import java.sql.SQLTransactionRollbackException;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.EnumMap;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
-/** Database product infered via JDBC. */
-public enum DatabaseProduct {
- DERBY, MYSQL, POSTGRES, ORACLE, SQLSERVER, OTHER;
+import org.apache.hadoop.conf.Configurable;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hive.metastore.api.MetaException;
+import org.apache.hadoop.hive.metastore.conf.MetastoreConf;
+import org.apache.hadoop.hive.metastore.conf.MetastoreConf.ConfVars;
+import org.apache.hadoop.util.ReflectionUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+/** Database product inferred via JDBC. Encapsulates all SQL logic associated
with
+ * the database product.
+ * This class is a singleton, which is instantiated the first time
+ * method determineDatabaseProduct is invoked.
+ * Tests that need to create multiple instances can use the reset method
+ * */
+public class DatabaseProduct implements Configurable {
+ static final private Logger LOG =
LoggerFactory.getLogger(DatabaseProduct.class.getName());
+
+ private static enum DbType {DERBY, MYSQL, POSTGRES, ORACLE, SQLSERVER,
EXTERNAL, OTHER};
+ public DbType dbType;
+
+ // Singleton instance
+ private static DatabaseProduct theDatabaseProduct;
+
+ static {
+ final Configuration conf = MetastoreConf.newMetastoreConf();
Review comment:
While adding a unit test, I realized that passing the conf object was
useful for testing. I guess this may be what you had in mind.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 486510)
Time Spent: 1h (was: 50m)
> Plugin for external DatabaseProduct in standalone HMS
> -----------------------------------------------------
>
> Key: HIVE-24120
> URL: https://issues.apache.org/jira/browse/HIVE-24120
> Project: Hive
> Issue Type: Improvement
> Components: Standalone Metastore
> Affects Versions: 3.1.1
> Reporter: Gustavo Arocena
> Assignee: Gustavo Arocena
> Priority: Minor
> Labels: pull-request-available
> Fix For: 4.0.0
>
> Time Spent: 1h
> Remaining Estimate: 0h
>
> Add a pluggable way to support ANSI compliant databases as backends for
> standalone HMS
--
This message was sent by Atlassian Jira
(v8.3.4#803005)