use of org.apache.hadoop.hive.ql.QueryState in project hive by apache.
the class TestExplainTask method testOutputPlanVectorizationJsonShouldMatch.
@Test
public void testOutputPlanVectorizationJsonShouldMatch() throws Exception {
QueryState qs = mock(QueryState.class);
when(qs.getHiveOperation()).thenReturn(HiveOperation.EXPLAIN);
HiveConf hiveConf = new HiveConf();
hiveConf.setBoolVar(HiveConf.ConfVars.HIVE_VECTORIZATION_ENABLED, true);
when(qs.getConf()).thenReturn(hiveConf);
uut.queryState = qs;
JsonNode result = objectMapper.readTree(uut.outputPlanVectorization(null, true).getRight().toString());
JsonNode expected = objectMapper.readTree("{\"enabled\":true,\"enabledConditionsMet\":[\"hive.vectorized.execution.enabled IS true\"]}");
assertEquals(expected, result);
hiveConf.setBoolVar(HiveConf.ConfVars.HIVE_VECTORIZATION_ENABLED, false);
result = objectMapper.readTree(uut.outputPlanVectorization(null, true).getRight().toString());
expected = objectMapper.readTree("{\"enabled\":false,\"enabledConditionsNotMet\":[\"hive.vectorized.execution.enabled IS false\"]}");
assertEquals(expected, result);
}
use of org.apache.hadoop.hive.ql.QueryState in project hive by apache.
the class TestQBJoinTreeApplyPredicate method initialize.
@BeforeClass
public static void initialize() {
queryState = new QueryState.Builder().withHiveConf(new HiveConf(SemanticAnalyzer.class)).build();
conf = queryState.getConf();
SessionState.start(conf);
}
use of org.apache.hadoop.hive.ql.QueryState in project hive by apache.
the class TestQBSubQuery method initialize.
@BeforeClass
public static void initialize() {
queryState = new QueryState.Builder().withHiveConf(new HiveConf(SemanticAnalyzer.class)).build();
conf = queryState.getConf();
SessionState.start(conf);
}
use of org.apache.hadoop.hive.ql.QueryState in project hive by apache.
the class TestUpdateDeleteSemanticAnalyzer method setup.
@Before
public void setup() {
queryState = new QueryState(null);
conf = queryState.getConf();
conf.setVar(HiveConf.ConfVars.HIVE_AUTHORIZATION_MANAGER, "org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory");
conf.setVar(HiveConf.ConfVars.DYNAMICPARTITIONINGMODE, "nonstrict");
conf.setVar(HiveConf.ConfVars.HIVEMAPREDMODE, "nonstrict");
conf.setVar(HiveConf.ConfVars.HIVE_TXN_MANAGER, "org.apache.hadoop.hive.ql.lockmgr.DbTxnManager");
}
use of org.apache.hadoop.hive.ql.QueryState in project hive by apache.
the class TestSemanticAnalyzerFactory method setup.
@Before
public void setup() throws Exception {
queryState = new QueryState(null);
conf = queryState.getConf();
}
Aggregations