use of org.apache.hadoop.hive.cli.CliSessionState in project hive by apache.
the class HBaseIntegrationTests method setupDriver.
protected void setupDriver() {
// This chicanery is necessary to make the driver work. Hive tests need the pfile file
// system, while the hbase one uses something else. So first make sure we've configured our
// hbase connection, then get a new config file and populate it as desired.
HBaseReadWrite.setConf(conf);
conf = new HiveConf();
conf.setVar(HiveConf.ConfVars.DYNAMICPARTITIONINGMODE, "nonstrict");
conf.setVar(HiveConf.ConfVars.METASTORE_RAW_STORE_IMPL, "org.apache.hadoop.hive.metastore.hbase.HBaseStore");
conf.setBoolVar(HiveConf.ConfVars.METASTORE_FASTPATH, true);
conf.setBoolVar(HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY, false);
// Setup so we can test SQL standard auth
conf.setBoolVar(HiveConf.ConfVars.HIVE_TEST_AUTHORIZATION_SQLSTD_HS2_MODE, true);
conf.setVar(HiveConf.ConfVars.HIVE_AUTHORIZATION_MANAGER, SQLStdHiveAuthorizerFactoryForTest.class.getName());
conf.setVar(HiveConf.ConfVars.HIVE_AUTHENTICATOR_MANAGER, SessionStateConfigUserAuthenticator.class.getName());
conf.setBoolVar(HiveConf.ConfVars.HIVE_AUTHORIZATION_ENABLED, true);
conf.setVar(HiveConf.ConfVars.USERS_IN_ADMIN_ROLE, System.getProperty("user.name"));
conf.setVar(HiveConf.ConfVars.HIVEMAPREDMODE, "nonstrict");
//HBaseReadWrite.setTestConnection(hconn);
SessionState.start(new CliSessionState(conf));
driver = new Driver(conf);
}
use of org.apache.hadoop.hive.cli.CliSessionState in project hive by apache.
the class TestHiveHistory method testQueryloglocParentDirNotExist.
public void testQueryloglocParentDirNotExist() throws Exception {
String parentTmpDir = tmpdir + "/HIVE2654";
Path parentDirPath = new Path(parentTmpDir);
try {
fs.delete(parentDirPath, true);
} catch (Exception e) {
}
try {
String actualDir = parentTmpDir + "/test";
HiveConf conf = new HiveConf(SessionState.class);
conf.set(HiveConf.ConfVars.HIVEHISTORYFILELOC.toString(), actualDir);
SessionState ss = new CliSessionState(conf);
HiveHistory hiveHistory = new HiveHistoryImpl(ss);
Path actualPath = new Path(actualDir);
if (!fs.exists(actualPath)) {
fail("Query location path is not exist :" + actualPath.toString());
}
} finally {
try {
fs.delete(parentDirPath, true);
} catch (Exception e) {
}
}
}
use of org.apache.hadoop.hive.cli.CliSessionState in project hive by apache.
the class TestPartitionNameWhitelistValidation method setupBeforeClass.
@BeforeClass
public static void setupBeforeClass() throws Exception {
System.setProperty(HiveConf.ConfVars.METASTORE_PARTITION_NAME_WHITELIST_PATTERN.varname, partitionValidationPattern);
hiveConf = new HiveConf();
SessionState.start(new CliSessionState(hiveConf));
msc = new HiveMetaStoreClient(hiveConf);
}
use of org.apache.hadoop.hive.cli.CliSessionState in project hive by apache.
the class TestHBaseMetastoreMetrics method before.
@Before
public void before() throws IOException {
HBaseReadWrite.setConf(conf);
conf = new HiveConf();
conf.setVar(HiveConf.ConfVars.METASTORE_RAW_STORE_IMPL, "org.apache.hadoop.hive.metastore.hbase.HBaseStore");
conf.setBoolVar(HiveConf.ConfVars.METASTORE_FASTPATH, true);
conf.setBoolVar(HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY, false);
conf.setBoolVar(HiveConf.ConfVars.METASTORE_METRICS, true);
conf.setVar(HiveConf.ConfVars.HIVE_METRICS_REPORTER, MetricsReporting.JSON_FILE.name() + "," + MetricsReporting.JMX.name());
SessionState.start(new CliSessionState(conf));
driver = new Driver(conf);
}
use of org.apache.hadoop.hive.cli.CliSessionState in project hive by apache.
the class TestMetastoreVersion method testVersionRestriction.
/**
* Test schema verification property
* @throws Exception
*/
public void testVersionRestriction() throws Exception {
System.setProperty(HiveConf.ConfVars.METASTORE_SCHEMA_VERIFICATION.toString(), "true");
hiveConf = new HiveConf(this.getClass());
assertTrue(hiveConf.getBoolVar(HiveConf.ConfVars.METASTORE_SCHEMA_VERIFICATION));
assertFalse(hiveConf.getBoolVar(HiveConf.ConfVars.METASTORE_AUTO_CREATE_ALL));
// session creation should fail since the schema didn't get created
try {
SessionState.start(new CliSessionState(hiveConf));
Hive.get(hiveConf).getMSC();
fail("An exception is expected since schema is not created.");
} catch (Exception re) {
LOG.info("Exception in testVersionRestriction: " + re, re);
String msg = HiveStringUtils.stringifyException(re);
assertTrue("Expected 'Version information not found in metastore' in: " + msg, msg.contains("Version information not found in metastore"));
}
}
Aggregations