private DiGraph<RexNodeRef, RexCall> buildComparisonGraph(List<RexNode> operands, SqlKind cmpForward) {
      DiGraph<RexNodeRef, RexCall> g = new DiGraph<>();
      for (RexNode node : operands) {
        if(!(node instanceof RexCall) ) {
          continue;
        }
        RexCall rexCall = (RexCall) node;
        SqlKind kind = rexCall.getKind();
        if (kind == cmpForward) {
          RexNode opA = rexCall.getOperands().get(0);
          RexNode opB = rexCall.getOperands().get(1);
          g.putEdgeValue(new RexNodeRef(opA), new RexNodeRef(opB), rexCall);
        } else if (kind == cmpForward.reverse()) {
          RexNode opA = rexCall.getOperands().get(1);
          RexNode opB = rexCall.getOperands().get(0);
          g.putEdgeValue(new RexNodeRef(opA), new RexNodeRef(opB), rexCall);
        }
      }
      return g;
    }
Builds a graph of the given comparison type.

The graph edges are annotated with the RexNodes representing the comparison.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HivePointLookupOptimizerRule.java