use of io.trino.sql.planner.plan.IndexJoinNode in project trino by trinodb.
the class IndexJoinMatcher method detailMatches.
@Override
public MatchResult detailMatches(PlanNode node, StatsProvider stats, Session session, Metadata metadata, SymbolAliases symbolAliases) {
checkState(shapeMatches(node), "Plan testing framework error: shapeMatches returned false in detailMatches in %s", this.getClass().getName());
IndexJoinNode indexJoinNode = (IndexJoinNode) node;
if (indexJoinNode.getCriteria().size() != criteria.size()) {
return NO_MATCH;
}
Set<IndexJoinNode.EquiJoinClause> actualCriteria = ImmutableSet.copyOf(indexJoinNode.getCriteria());
Set<IndexJoinNode.EquiJoinClause> expectedCriteria = criteria.stream().map(equiClause -> equiClause.getExpectedValue(symbolAliases)).collect(toImmutableSet());
if (!expectedCriteria.equals(actualCriteria)) {
return NO_MATCH;
}
if (!indexJoinNode.getProbeHashSymbol().equals(probeHashSymbol.map(alias -> alias.toSymbol(symbolAliases)))) {
return NO_MATCH;
}
if (!indexJoinNode.getIndexHashSymbol().equals(indexHashSymbol.map(alias -> alias.toSymbol(symbolAliases)))) {
return NO_MATCH;
}
return MatchResult.match();
}
Aggregations