use of org.apache.hadoop.hive.ql.plan.mapper.SimpleRuntimeStatsSource in project hive by apache.
the class ReOptimizePlugin method prepareToReExecute.
@Override
public void prepareToReExecute() {
statsReaderHook.setCollectOnSuccess(true);
PlanMapper pm = coreDriver.getContext().getPlanMapper();
coreDriver.setRuntimeStatsSource(new SimpleRuntimeStatsSource(pm));
retryPossible = false;
}
use of org.apache.hadoop.hive.ql.plan.mapper.SimpleRuntimeStatsSource in project hive by apache.
the class TestCounterMapping method testUsageOfRuntimeInfo.
@Test
public void testUsageOfRuntimeInfo() throws ParseException {
IDriver driver = createDriver();
String query = "select sum(u) from tu where u>1";
PlanMapper pm1 = getMapperForQuery(driver, query);
List<FilterOperator> filters1 = pm1.getAll(FilterOperator.class);
filters1.sort(OPERATOR_ID_COMPARATOR.reversed());
FilterOperator filter1 = filters1.get(0);
driver = createDriver();
((ReExecDriver) driver).setRuntimeStatsSource(new SimpleRuntimeStatsSource(pm1));
PlanMapper pm2 = getMapperForQuery(driver, query);
List<FilterOperator> filters2 = pm2.getAll(FilterOperator.class);
filters2.sort(OPERATOR_ID_COMPARATOR.reversed());
FilterOperator filter2 = filters2.get(0);
assertEquals("original check", 7, filter1.getStatistics().getNumRows());
assertEquals("optimized check", 6, filter2.getStatistics().getNumRows());
}
Aggregations