use of io.prestosql.sql.planner.plan.TopNRankingNumberNode in project hetu-core by openlookeng.
the class TopNRankingNumberMatcher 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());
TopNRankingNumberNode topNRankingNumberNode = (TopNRankingNumberNode) node;
if (specification.isPresent()) {
WindowNode.Specification expected = specification.get().getExpectedValue(symbolAliases);
if (!expected.equals(topNRankingNumberNode.getSpecification())) {
return NO_MATCH;
}
}
if (rowNumberSymbol.isPresent()) {
Symbol expected = rowNumberSymbol.get().toSymbol(symbolAliases);
if (!expected.equals(topNRankingNumberNode.getRowNumberSymbol())) {
return NO_MATCH;
}
}
if (maxRowCountPerPartition.isPresent()) {
if (!maxRowCountPerPartition.get().equals(topNRankingNumberNode.getMaxRowCountPerPartition())) {
return NO_MATCH;
}
}
if (partial.isPresent()) {
if (!partial.get().equals(topNRankingNumberNode.isPartial())) {
return NO_MATCH;
}
}
if (hashSymbol.isPresent()) {
Optional<Symbol> expected = hashSymbol.get().map(alias -> alias.toSymbol(symbolAliases));
if (!expected.equals(topNRankingNumberNode.getHashSymbol())) {
return NO_MATCH;
}
}
return match();
}
Aggregations