Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-26767

Support for custom RDBMS is broken

    XMLWordPrintableJSON

Details

    Description

      HIVE-24120 introduced code to support custom RDBMS.

      DatabaseProduct.getDbType(String productName) will return DbType.UNDEFINED for anything other than the hardcoded/internally supported database types.

      When initializing DatabaseProduct with an external/custom RDBMS, it follows this logic:

       

              boolean isExternal = MetastoreConf.getBoolVar(conf, ConfVars.USE_CUSTOM_RDBMS);

              if (isExternal) {
                // The DatabaseProduct will be created by instantiating an external class via
                // reflection. The external class can override any method in the current class
                String className = MetastoreConf.getVar(conf, ConfVars.CUSTOM_RDBMS_CLASSNAME);

                if (className != null) {
                  try {
                    theDatabaseProduct = (DatabaseProduct)
                        ReflectionUtils.newInstance(Class.forName(className), conf);

                    LOG.info(String.format("Using custom RDBMS %s", className));
                    dbt = DbType.CUSTOM;

      These 2 database types (DbType.UNDEFINED, DbType.CUSTOM) are then compared to each other to make sure they are the same.

       

      Preconditions.checkState(theDatabaseProduct.dbType == getDbType(productName));

       

      https://github.com/gatorblue/hive/blob/3a65c6cf9cb552e7c34bfb449a419abfde0a58b6/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/DatabaseProduct.java#L80

       

      Attachments

        Issue Links

          Activity

            People

              tthorpeca Tim Thorpe
              tthorpeca Tim Thorpe
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 20m
                  2h 20m