Search in sources :

Example 6 with LimitNode

use of com.facebook.presto.spi.plan.LimitNode in project presto by prestodb.

the class TestEffectivePredicateExtractor method testLimit.

@Test
public void testLimit() {
    PlanNode node = new LimitNode(Optional.empty(), newId(), filter(baseTableScan, and(equals(AV, BV), equals(BV, CV), lessThan(CV, bigintLiteral(10)))), 1, FINAL);
    RowExpression effectivePredicate = effectivePredicateExtractor.extract(node);
    // Pass through
    assertEquals(normalizeConjuncts(effectivePredicate), normalizeConjuncts(equals(AV, BV), equals(BV, CV), lessThan(CV, bigintLiteral(10))));
}
Also used : PlanNode(com.facebook.presto.spi.plan.PlanNode) LimitNode(com.facebook.presto.spi.plan.LimitNode) RowExpression(com.facebook.presto.spi.relation.RowExpression) Test(org.testng.annotations.Test)

Aggregations

LimitNode (com.facebook.presto.spi.plan.LimitNode)6 PlanNode (com.facebook.presto.spi.plan.PlanNode)5 Assignments (com.facebook.presto.spi.plan.Assignments)2 ProjectNode (com.facebook.presto.spi.plan.ProjectNode)2 VariableReferenceExpression (com.facebook.presto.spi.relation.VariableReferenceExpression)2 Session (com.facebook.presto.Session)1 SystemSessionProperties (com.facebook.presto.SystemSessionProperties)1 SystemSessionProperties.isPrintStatsForNonJoinQuery (com.facebook.presto.SystemSessionProperties.isPrintStatsForNonJoinQuery)1 QualifiedObjectName (com.facebook.presto.common.QualifiedObjectName)1 TupleDomain (com.facebook.presto.common.predicate.TupleDomain)1 BIGINT (com.facebook.presto.common.type.BigintType.BIGINT)1 Type (com.facebook.presto.common.type.Type)1 VARBINARY (com.facebook.presto.common.type.VarbinaryType.VARBINARY)1 CachingCostProvider (com.facebook.presto.cost.CachingCostProvider)1 CachingStatsProvider (com.facebook.presto.cost.CachingStatsProvider)1 CostCalculator (com.facebook.presto.cost.CostCalculator)1 CostProvider (com.facebook.presto.cost.CostProvider)1 StatsAndCosts (com.facebook.presto.cost.StatsAndCosts)1 StatsCalculator (com.facebook.presto.cost.StatsCalculator)1 StatsProvider (com.facebook.presto.cost.StatsProvider)1