Search in sources :

Example 1 with RuntimeStatsSource

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;
}
Also used : RuntimeStatsSource(org.apache.hadoop.hive.ql.plan.mapper.RuntimeStatsSource) OperatorStats(org.apache.hadoop.hive.ql.stats.OperatorStats) Statistics(org.apache.hadoop.hive.ql.plan.Statistics) ColStatistics(org.apache.hadoop.hive.ql.plan.ColStatistics)

Aggregations

ColStatistics (org.apache.hadoop.hive.ql.plan.ColStatistics)1 Statistics (org.apache.hadoop.hive.ql.plan.Statistics)1 RuntimeStatsSource (org.apache.hadoop.hive.ql.plan.mapper.RuntimeStatsSource)1 OperatorStats (org.apache.hadoop.hive.ql.stats.OperatorStats)1