use of io.trino.sql.planner.plan.DistinctLimitNode in project trino by trinodb.
the class DistinctLimitMatcher 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());
DistinctLimitNode distinctLimitNode = (DistinctLimitNode) node;
if (distinctLimitNode.getLimit() != limit) {
return NO_MATCH;
}
if (!distinctLimitNode.getHashSymbol().equals(hashSymbol.map(alias -> alias.toSymbol(symbolAliases)))) {
return NO_MATCH;
}
return new MatchResult(ImmutableSet.copyOf(distinctLimitNode.getDistinctSymbols()).equals(distinctSymbols.stream().map(alias -> alias.toSymbol(symbolAliases)).collect(toImmutableSet())));
}
Aggregations