use of org.apache.hadoop.hive.conf.HiveConf in project hive by apache.
the class TestSetProcessor method before.
@BeforeClass
public static void before() throws Exception {
Map<String, String> env = new HashMap<>();
env.put(TEST_ENV_VAR_PASSWORD, TEST_ENV_VAR_PASSWORD_VALUE);
setEnv(env);
System.setProperty(TEST_SYSTEM_PROPERTY, TEST_SYSTEM_PROPERTY_VALUE);
HiveConf conf = new HiveConf();
SessionState.start(conf);
state = SessionState.get();
}
use of org.apache.hadoop.hive.conf.HiveConf in project hive by apache.
the class TestSQLStdHiveAccessControllerCLI method testConfigProcessing.
/**
* Test that SQLStdHiveAccessController is not applying config restrictions on CLI
*
* @throws HiveAuthzPluginException
*/
@Test
public void testConfigProcessing() throws HiveAuthzPluginException {
HiveConf processedConf = new HiveConf();
SQLStdHiveAccessController accessController = new SQLStdHiveAccessController(null, processedConf, new HadoopDefaultAuthenticator(), getCLISessionCtx());
accessController.applyAuthorizationConfigPolicy(processedConf);
// check that hook to disable transforms has not been added
assertFalse("Check for transform query disabling hook", processedConf.getVar(ConfVars.PREEXECHOOKS).contains(DisallowTransformHook.class.getName()));
// verify that some dummy param can be set
processedConf.verifyAndSet("dummy.param", "dummy.val");
processedConf.verifyAndSet(ConfVars.HIVE_AUTHORIZATION_ENABLED.varname, "true");
}
use of org.apache.hadoop.hive.conf.HiveConf in project hive by apache.
the class TestPrivilegesV2 method setup.
@Before
public void setup() throws Exception {
queryState = new QueryState(null);
//set authorization mode to V2
HiveConf conf = queryState.getConf();
conf.setVar(HiveConf.ConfVars.HIVE_AUTHORIZATION_MANAGER, SQLStdHiveAuthorizerFactory.class.getName());
db = Mockito.mock(Hive.class);
table = new Table(DB, TABLE);
SessionState.start(conf);
Mockito.when(db.getTable(DB, TABLE, false)).thenReturn(table);
Mockito.when(db.getTable(TABLE_QNAME, false)).thenReturn(table);
Mockito.when(db.getPartition(table, new HashMap<String, String>(), false)).thenReturn(partition);
}
use of org.apache.hadoop.hive.conf.HiveConf in project hive by apache.
the class TestSessionUserName method getAuthV2HiveConf.
/**
* @return HiveConf with authorization V2 enabled with a dummy authorization factory
* that captures the given user name
*/
private HiveConf getAuthV2HiveConf() {
HiveConf conf = new HiveConf();
conf.setVar(HiveConf.ConfVars.HIVE_AUTHORIZATION_MANAGER, HiveAuthorizerStoringUserNameFactory.class.getName());
conf.setVar(HiveConf.ConfVars.HIVE_AUTHENTICATOR_MANAGER, SessionStateUserAuthenticator.class.getName());
return conf;
}
use of org.apache.hadoop.hive.conf.HiveConf in project hive by apache.
the class TestIUD method initialize.
@BeforeClass
public static void initialize() {
conf = new HiveConf(SemanticAnalyzer.class);
SessionState.start(conf);
}
Aggregations