use of org.apache.hadoop.hive.ql.plan.mapper.RuntimeStatsSource in project hive by apache.
the class StatsRulesProcFactory method applyRuntimeStats.
private static Statistics applyRuntimeStats(Context context, Statistics stats, Operator<?> op) {
if (!context.getRuntimeStatsSource().isPresent()) {
return stats;
}
RuntimeStatsSource rss = context.getRuntimeStatsSource().get();
Optional<OperatorStats> os = rss.lookup(op);
if (!os.isPresent()) {
return stats;
}
LOG.debug("using runtime stats for {}; {}", op, os.get());
Statistics outStats = stats.clone();
outStats = outStats.scaleToRowCount(os.get().getOutputRecords(), false);
outStats.setRuntimeStats(true);
return outStats;
}
Aggregations