use of org.apache.hadoop.hive.ql.optimizer.signature.RelTreeSignature in project hive by apache.
the class StatsSources method extractStatsFromPlanMapper.
private static ImmutableList<PersistedRuntimeStats> extractStatsFromPlanMapper(PlanMapper pm) {
Builder<PersistedRuntimeStats> li = ImmutableList.builder();
Iterator<EquivGroup> it = pm.iterateGroups();
while (it.hasNext()) {
EquivGroup e = it.next();
List<OperatorStats> stat = e.getAll(OperatorStats.class);
List<OpTreeSignature> sig = e.getAll(OpTreeSignature.class);
List<RelTreeSignature> rSig = e.getAll(RelTreeSignature.class);
if (stat.size() > 1 || sig.size() > 1) {
StringBuffer sb = new StringBuffer();
sb.append(String.format("expected(stat-sig) 1-1, got {}-{} ;", stat.size(), sig.size()));
for (OperatorStats s : stat) {
sb.append(s);
sb.append(";");
}
for (OpTreeSignature s : sig) {
sb.append(s);
sb.append(";");
}
LOG.debug(sb.toString());
}
if (stat.size() < 1 || sig.size() < 1) {
continue;
}
if (e.getAll(OperatorStats.IncorrectRuntimeStatsMarker.class).size() > 0) {
LOG.debug("Ignoring {}, marked with OperatorStats.IncorrectRuntimeStatsMarker", sig.get(0));
continue;
}
if (e.getAll(OperatorStats.MayNotUseForRelNodes.class).size() > 0) {
rSig = new ArrayList<>();
}
li.add(new PersistedRuntimeStats(first(sig), first(stat), first(rSig)));
}
return li.build();
}
Aggregations