Class HyperEdge

java.lang.Object
org.apache.calcite.rel.rules.HyperEdge

public class HyperEdge extends Object
Edge in HyperGraph, that represents a join predicate.
  • Constructor Details

    • HyperEdge

      public HyperEdge(org.apache.calcite.rel.rules.HyperEdge.TotalEligibilitySet tes, List<ConflictRule> conflictRules, long leftNodeUsedInPredicate, long rightNodeUsedInPredicate, long initialLeftNodeBits, long initialRightNodeBits, JoinRelType joinType, RexNode condition)
  • Method Details

    • getEndpoint

      public long getEndpoint()
    • getLeftEndpoint

      public long getLeftEndpoint()
    • getRightEndpoint

      public long getRightEndpoint()
    • getLeftNodeUsedInPredicate

      public long getLeftNodeUsedInPredicate()
    • getRightNodeUsedInPredicate

      public long getRightNodeUsedInPredicate()
    • getConflictRules

      public List<ConflictRule> getConflictRules()
    • getInitialLeftNodeBits

      public long getInitialLeftNodeBits()
    • getInitialRightNodeBits

      public long getInitialRightNodeBits()
    • isSimple

      public boolean isSimple()
    • getJoinType

      public JoinRelType getJoinType()
    • getCondition

      public RexNode getCondition()
    • toString

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

      public HyperEdge accept(RexShuttle shuttle)
    • adjustNodeBit

      public HyperEdge adjustNodeBit(int nodeOffset)
      When JoinToHyperGraphRule constructs a hypergraph , if the right child of Join is a HyperGraph class, all bitmaps related to inputs in this right child need to be shifted according to the number of inputs in the left child of Join.
      Parameters:
      nodeOffset - number of inputs in the left child
      Returns:
      HyperEdge produced after shifting
    • createHyperEdgesFromJoinConds

      public static List<HyperEdge> createHyperEdgesFromJoinConds(Map<Integer,Integer> inputRefToNodeIndexMap, Map<Integer,Integer> inputRefToFieldIndexMap, List<RexNode> joinConds, List<ConflictRule> conflictRules, JoinRelType joinType, int leftNodeCount, int nodeCount)
      Build hyperedges corresponding to a join operator. The construction of a HyperEdge includes total eligibility set, conflict rules, node-related bitmaps, predicate expressions (RexInputRef is replaced by RexNodeAndFieldIndex) and join type.
      Parameters:
      inputRefToNodeIndexMap - a map from inputRef to node index
      inputRefToFieldIndexMap - a map from inputRef to field index
      joinConds - join conditions
      conflictRules - all conflict rules
      joinType - join type
      leftNodeCount - number of inputs in the left child of Join
      nodeCount - number of inputs of Join
      Returns:
      HyperEdge list