} else { boolean isInTest = MetastoreConf.getBoolVar(conf, ConfVars.HIVE_IN_TEST); isCompatibleDatastore = (!isInTest || ensureDbInit()) && runTestQuery(); if (isCompatibleDatastore) { LOG.debug("Using direct SQL, underlying DB is " + dbType);
public MetaStoreDirectSql(PersistenceManager pm, Configuration conf) { this.pm = pm; this.dbType = determineDbType(); int batchSize = HiveConf.getIntVar(conf, ConfVars.METASTORE_DIRECT_SQL_PARTITION_BATCH_SIZE); if (batchSize == DETECT_BATCHING) { batchSize = (dbType == DB.ORACLE || dbType == DB.MSSQL) ? 1000 : NO_BATCHING; } this.batchSize = batchSize; convertMapNullsToEmptyStrings = HiveConf.getBoolVar(conf, ConfVars.METASTORE_ORM_RETRIEVE_MAPNULLS_AS_EMPTY_STRINGS); 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); } }
public MetaStoreDirectSql(PersistenceManager pm, Configuration conf) { this.pm = pm; this.dbType = determineDbType(); int batchSize = HiveConf.getIntVar(conf, ConfVars.METASTORE_DIRECT_SQL_PARTITION_BATCH_SIZE); if (batchSize == DETECT_BATCHING) { batchSize = (dbType == DB.ORACLE || dbType == DB.MSSQL) ? 1000 : NO_BATCHING; } this.batchSize = batchSize; convertMapNullsToEmptyStrings = HiveConf.getBoolVar(conf, ConfVars.METASTORE_ORM_RETRIEVE_MAPNULLS_AS_EMPTY_STRINGS); 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); } }