Class RelDecorrelator.CorelMap

java.lang.Object
org.apache.calcite.sql2rel.RelDecorrelator.CorelMap
Enclosing class:
RelDecorrelator

protected static class RelDecorrelator.CorelMap extends Object
A map of the locations of Correlate in a tree of RelNodes.

It is used to drive the decorrelation process. Treat it as immutable; rebuild if you modify the tree.

There are three maps:

  1. mapRefRelToCorRef maps a RelNode to the correlated variables it references;
  2. mapCorToCorRel maps a correlated variable to the Correlate providing it;
  3. mapFieldAccessToCorRef maps a rex field access to the corVar it represents. Because typeFlattener does not clone or modify a correlated field access this map does not need to be updated.
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • of

      public static RelDecorrelator.CorelMap of(com.google.common.collect.SortedSetMultimap<RelNode,org.apache.calcite.sql2rel.RelDecorrelator.CorRef> mapRefRelToCorVar, NavigableMap<CorrelationId,RelNode> mapCorToCorRel, Map<RexFieldAccess,org.apache.calcite.sql2rel.RelDecorrelator.CorRef> mapFieldAccessToCorVar)
      Creates a CorelMap with given contents.
    • getMapCorToCorRel

      public NavigableMap<CorrelationId,RelNode> getMapCorToCorRel()
    • hasCorrelation

      public boolean hasCorrelation()
      Returns whether there are any correlating variables in this statement.
      Returns:
      whether there are any correlating variables