Search in sources :

Example 1 with RemoveUnsupportedDynamicFilters

use of com.facebook.presto.sql.planner.iterative.rule.RemoveUnsupportedDynamicFilters in project presto by prestodb.

the class TestRemoveUnsupportedDynamicFilters method removeUnsupportedDynamicFilters.

PlanNode removeUnsupportedDynamicFilters(PlanNode root) {
    return getQueryRunner().inTransaction(session -> {
        // metadata.getCatalogHandle() registers the catalog for the transaction
        session.getCatalog().ifPresent(catalog -> metadata.getCatalogHandle(session, catalog));
        PlanNode rewrittenPlan = new RemoveUnsupportedDynamicFilters(metadata.getFunctionAndTypeManager()).optimize(root, session, TypeProvider.empty(), new PlanVariableAllocator(), new PlanNodeIdAllocator(), WarningCollector.NOOP);
        new DynamicFiltersChecker().validate(rewrittenPlan, session, metadata, new SqlParser(), TypeProvider.empty(), WarningCollector.NOOP);
        return rewrittenPlan;
    });
}
Also used : PlanNode(com.facebook.presto.spi.plan.PlanNode) PlanNodeIdAllocator(com.facebook.presto.spi.plan.PlanNodeIdAllocator) SqlParser(com.facebook.presto.sql.parser.SqlParser) PlanVariableAllocator(com.facebook.presto.sql.planner.PlanVariableAllocator) DynamicFiltersChecker(com.facebook.presto.sql.planner.sanity.DynamicFiltersChecker) RemoveUnsupportedDynamicFilters(com.facebook.presto.sql.planner.iterative.rule.RemoveUnsupportedDynamicFilters)

Aggregations

PlanNode (com.facebook.presto.spi.plan.PlanNode)1 PlanNodeIdAllocator (com.facebook.presto.spi.plan.PlanNodeIdAllocator)1 SqlParser (com.facebook.presto.sql.parser.SqlParser)1 PlanVariableAllocator (com.facebook.presto.sql.planner.PlanVariableAllocator)1 RemoveUnsupportedDynamicFilters (com.facebook.presto.sql.planner.iterative.rule.RemoveUnsupportedDynamicFilters)1 DynamicFiltersChecker (com.facebook.presto.sql.planner.sanity.DynamicFiltersChecker)1