use of io.prestosql.sql.planner.plan.SortNode in project hetu-core by openlookeng.
the class SortMatcher 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());
SortNode sortNode = (SortNode) node;
if (!orderingSchemeMatches(orderBy, sortNode.getOrderingScheme(), symbolAliases)) {
return NO_MATCH;
}
return MatchResult.match();
}
use of io.prestosql.sql.planner.plan.SortNode in project hetu-core by openlookeng.
the class MergeLimitOverProjectWithSort method apply.
@Override
public Result apply(LimitNode parent, Captures captures, Context context) {
ProjectNode project = captures.get(PROJECT);
SortNode sort = captures.get(SORT);
return Result.ofPlanNode(project.replaceChildren(ImmutableList.of(new TopNNode(parent.getId(), sort.getSource(), parent.getCount(), sort.getOrderingScheme(), parent.isPartial() ? PARTIAL : SINGLE))));
}
use of io.prestosql.sql.planner.plan.SortNode in project hetu-core by openlookeng.
the class TestEffectivePredicateExtractor method testSort.
@Test
public void testSort() {
PlanNode node = new SortNode(newId(), filter(baseTableScan, and(equals(AE, BE), equals(BE, CE), lessThan(CE, bigintLiteral(10)))), new OrderingScheme(ImmutableList.of(A), ImmutableMap.of(A, SortOrder.ASC_NULLS_LAST)), false);
Expression effectivePredicate = effectivePredicateExtractor.extract(SESSION, node, TypeProvider.empty(), typeAnalyzer);
// Pass through
assertEquals(normalizeConjuncts(effectivePredicate), normalizeConjunctsSet(equals(AE, BE), equals(BE, CE), lessThan(CE, bigintLiteral(10))));
}
Aggregations