Class RelOptMaterializations

java.lang.Object
org.apache.calcite.plan.RelOptMaterializations

public abstract class RelOptMaterializations extends Object
Utility methods for using materialized views and lattices for queries.
  • 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 RelNode
      materializations - 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 RelNode
      materializations - the materialized view list
      materializationRules - 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 RelNode
      lattices - 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.