use of org.apache.hadoop.hive.ql.IDriver in project hive by apache.
the class TestCounterMapping method afterClass.
@AfterClass
public static void afterClass() throws Exception {
IDriver driver = createDriver();
dropTables(driver);
}
use of org.apache.hadoop.hive.ql.IDriver in project hive by apache.
the class TestOperatorCmp method afterClass.
@AfterClass
public static void afterClass() throws Exception {
IDriver driver = createDriver();
dropTables(driver);
}
use of org.apache.hadoop.hive.ql.IDriver in project hive by apache.
the class TestOperatorCmp method createDriver.
private static IDriver createDriver() {
HiveConf conf = env_setup.getTestCtx().hiveConf;
conf.setBoolVar(ConfVars.HIVE_QUERY_REEXECUTION_ENABLED, true);
conf.setBoolVar(ConfVars.HIVE_QUERY_REEXECUTION_ALWAYS_COLLECT_OPERATOR_STATS, true);
conf.setVar(ConfVars.HIVE_QUERY_REEXECUTION_STRATEGIES, "reoptimize");
conf.set("zzz", "1");
conf.set("reexec.overlay.zzz", "2000");
//
conf.setVar(HiveConf.ConfVars.HIVE_AUTHORIZATION_MANAGER, "org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory");
HiveConf.setBoolVar(conf, HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY, false);
HiveConf.setVar(conf, HiveConf.ConfVars.POSTEXECHOOKS, OperatorStatsReaderHook.class.getName());
SessionState.start(conf);
IDriver driver = DriverFactory.newDriver(conf);
return driver;
}
use of org.apache.hadoop.hive.ql.IDriver in project hive by apache.
the class TestReOptimization method testExplainSupport.
@Test
public void testExplainSupport() throws Exception {
IDriver driver = createDriver("overlay,reoptimize");
String query = "explain reoptimization select 1 from tu join tv on (tu.id_uv=tv.id_uv) where u<10 and v>1";
PlanMapper pm = getMapperForQuery(driver, query);
List<String> res = new ArrayList<>();
List<String> res1 = new ArrayList<>();
while (driver.getResults(res1)) {
res.addAll(res1);
}
assertEquals("2TS", 2, res.stream().filter(line -> line.contains("TS_")).count());
assertEquals("2TS(runtime)", 2, res.stream().filter(line -> line.contains("TS") && line.contains("runtime")).count());
}
Aggregations