use of com.facebook.presto.spi.plan.FilterNode in project presto by prestodb.
the class TestPinotPlanOptimizer method testTimestampCastingPredicatePushdown.
@Test
public void testTimestampCastingPredicatePushdown() {
PlanBuilder planBuilder = createPlanBuilder(defaultSessionHolder);
FilterNode filter = filter(planBuilder, tableScan(planBuilder, pinotTable, regionId, city, fare, millisSinceEpoch), getRowExpression("cast(millissinceepoch as date) < DATE '2014-01-31'", defaultSessionHolder));
PlanNode originalPlan = limit(planBuilder, 50L, filter);
PlanNode optimized = getOptimizedPlan(planBuilder, originalPlan);
assertPlanMatch(optimized, PinotTableScanMatcher.match(pinotTable, Optional.of("SELECT regionId, city, fare, millisSinceEpoch FROM hybrid WHERE \\(millisSinceEpoch < 1391126400000\\) LIMIT 50"), Optional.of(false), originalPlan.getOutputVariables(), useSqlSyntax()), typeProvider);
}
Aggregations