core/src/main/java/org/apache/calcite/rel/rules/FilterJoinRule.java
protected List<RexNode> inferJoinEqualConditions(List<RexNode> rexNodes, Join join) {
    final List<RexNode> result = new ArrayList<>(rexNodes.size());
    final List<Set<Integer>> equalSets = splitEqualSets(rexNodes, result);

    boolean needOptimize = false;
    for (Set<Integer> set : equalSets) {
      if (set.size() > 2) {
        needOptimize = true;
        break;
      }
    }
    if (!needOptimize) {
      // Keep the conditions unchanged.
      return rexNodes;
    }

    result.addAll(constructConditionFromEqualSets(join, equalSets));
    return result;
  }
/**
   * Infers more equal conditions for the join condition.
   *
   * <p> For example, in {@code SELECT * FROM T1, T2, T3 WHERE T1.id = T3.id AND T2.id = T3.id},
   * we can infer {@code T1.id = T2.id} for the first Join node from second Join node's condition:
   * {@code T1.id = T3.id AND T2.id = T3.id}.
   *
   * <p>For the above SQL, the second Join's condition is {@code T1.id = T3.id AND T2.id = T3.id}.
   * After inference, the final condition would be: {@code T1.id = T2.id AND T1.id = T3.id}, the
   * {@code T1.id = T2.id} can be further pushed into LHS.
   *
   * @param rexNodes the Join condition
   * @param join the Join node
   * @return the newly inferred conditions
   */
Infers more equal conditions for the join condition.



@param rexNodes the Join condition
@param join the Join node
@return the newly inferred conditions
Infers more equal conditions for the join condition . @param rexNodes the Join condition @param join the Join node @return the newly inferred conditions
protected List<RexNode> inferJoinEqualConditions(List<RexNode> rexNodes, Join join) {
    final List<RexNode> result = new ArrayList<>(rexNodes.size());
    final List<Set<Integer>> equalSets = splitEqualSets(rexNodes, result);
    boolean needOptimize = false;
    for (Set<Integer> set : equalSets) {
      if (set.size() > 2) {
        needOptimize = true;
        break;
      }
    }
    if (!needOptimize) {
      return rexNodes;
    }
    result.addAll(constructConditionFromEqualSets(join, equalSets));
    return result;
  }
protected List < RexNode > inferJoinEqualConditions ( List < RexNode > rexNodes , Join join ) { final List < RexNode > result = new ArrayList < > ( rexNodes . size ( ) ) ; final List < Set < Integer > > equalSets = splitEqualSets ( rexNodes , result ) ; boolean needOptimize = false ; for ( Set < Integer > set : equalSets ) { if ( set . size ( ) > 2 ) { needOptimize = true ; break ; } } if ( ! needOptimize ) { return rexNodes ; } result . addAll ( constructConditionFromEqualSets ( join , equalSets ) ) ; return result ; }
Infers more equal conditions for the join condition.
Infers more equal conditions for the join condition .
// Keep the conditions unchanged.