private static RexNode handleOR(RexBuilder rexBuilder, RexCall call) {
      // IN clauses need to be combined by keeping all elements
      final List<RexNode> operands = new ArrayList<>(RexUtil.flattenOr(call.getOperands()));
      final Multimap<RexNode,SimilarRexNodeElement> inLHSExprToRHSExprs = LinkedHashMultimap.create();
      for (int i = 0; i < operands.size(); i++) {
        RexNode operand = operands.get(i);
        if (operand instanceof RexCall && HiveIn.INSTANCE.equals(((RexCall) operand).op)) {
          RexCall inCall = (RexCall) operand;
          if (!HiveCalciteUtil.isDeterministic(inCall.getOperands().get(0))) {
            continue;
          }
          RexNode ref = inCall.getOperands().get(0);
          for (int j = 1; j < inCall.getOperands().size(); j++) {
            inLHSExprToRHSExprs.put(ref, new SimilarRexNodeElement(inCall.getOperands().get(j)));
          }
          operands.remove(i);
          --i;
        }
      }
      // Create IN clauses (fourth parameter is not needed since no expressions were removed)
      final List<RexNode> newOperands = createInClauses(rexBuilder,
          inLHSExprToRHSExprs.keySet(), inLHSExprToRHSExprs, null);
      newOperands.addAll(operands);
      // Return node
      RexNode result = RexUtil.composeDisjunction(rexBuilder, newOperands, false);
      if (!result.getType().equals(call.getType())) {
        return rexBuilder.makeCast(call.getType(), result, true);
      }
      return result;
    }
Check if the type of nodes in the two collections is homogeneous within the collections
and identical between them.
@param nodes1 the first collection of nodes
@param nodes2 the second collection of nodes
@return true if nodes in both collections is unique and identical, false otherwise
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HivePointLookupOptimizerRule.java