Package org.apache.calcite.plan
Class RelOptMaterializations
java.lang.Object
org.apache.calcite.plan.RelOptMaterializations
Utility methods for using
materialized views and lattices for queries.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<RelOptMaterialization>
getApplicableMaterializations
(RelNode rel, List<RelOptMaterialization> materializations) Returns a list of materializations that can potentially be used by the query.static List<Pair<RelNode,
RelOptLattice>> useLattices
(RelNode rel, List<RelOptLattice> lattices) Returns a list of RelNode transformed from all possible lattice uses.static List<Pair<RelNode,
List<RelOptMaterialization>>> useMaterializedViews
(RelNode rel, List<RelOptMaterialization> materializations) Returns a list of RelNode transformed from all possible combination of materialized view uses.static List<Pair<RelNode,
List<RelOptMaterialization>>> useMaterializedViews
(RelNode rel, List<RelOptMaterialization> materializations, List<SubstitutionVisitor.UnifyRule> materializationRules) Returns a list of RelNode transformed from all possible combination of materialized view uses.
-
Constructor Details
-
RelOptMaterializations
public RelOptMaterializations()
-
-
Method Details
-
useMaterializedViews
public static List<Pair<RelNode,List<RelOptMaterialization>>> useMaterializedViews(RelNode rel, List<RelOptMaterialization> materializations) Returns a list of RelNode transformed from all possible combination of materialized view uses. Big queries will likely have more than one transformed RelNode, e.g., (t1 group by c1) join (t2 group by c2).- Parameters:
rel
- the original RelNodematerializations
- the materialized view list- Returns:
- the list of transformed RelNode together with their corresponding materialized views used in the transformation.
-
useMaterializedViews
public static List<Pair<RelNode,List<RelOptMaterialization>>> useMaterializedViews(RelNode rel, List<RelOptMaterialization> materializations, List<SubstitutionVisitor.UnifyRule> materializationRules) Returns a list of RelNode transformed from all possible combination of materialized view uses. Big queries will likely have more than one transformed RelNode, e.g., (t1 group by c1) join (t2 group by c2). In addition, you can add custom materialized view recognition rules.- Parameters:
rel
- the original RelNodematerializations
- the materialized view listmaterializationRules
- the materialized view recognition rules- Returns:
- the list of transformed RelNode together with their corresponding materialized views used in the transformation.
-
useLattices
public static List<Pair<RelNode,RelOptLattice>> useLattices(RelNode rel, List<RelOptLattice> lattices) Returns a list of RelNode transformed from all possible lattice uses.- Parameters:
rel
- the original RelNodelattices
- the lattice list- Returns:
- the list of transformed RelNode together with their corresponding lattice used in the transformation.
-
getApplicableMaterializations
public static List<RelOptMaterialization> getApplicableMaterializations(RelNode rel, List<RelOptMaterialization> materializations) Returns a list of materializations that can potentially be used by the query.
-