public static List<RexNode> transformInToOrOperands(List<RexNode> operands, RexBuilder rexBuilder) {
    final List<RexNode> disjuncts = new ArrayList<>(operands.size() - 2);
    if (operands.get(0).getKind() != SqlKind.ROW) {
      final RexNode columnExpression = operands.get(0);
      if (!HiveCalciteUtil.isDeterministic(columnExpression)) {
        // Bail out
        return null;
      }
      for (int i = 1; i < operands.size(); i++) {
        final RexNode valueExpression = operands.get(i);
        if (!HiveCalciteUtil.isDeterministic(valueExpression)) {
          // Bail out
          return null;
        }
        disjuncts.add(rexBuilder.makeCall(
            SqlStdOperatorTable.EQUALS,
            columnExpression,
            valueExpression));
      }
    } else {
      final RexCall columnExpressions = (RexCall) operands.get(0);
      if (!HiveCalciteUtil.isDeterministic(columnExpressions)) {
        // Bail out
        return null;
      }
      for (int i = 1; i < operands.size(); i++) {
        List<RexNode> conjuncts = new ArrayList<>(columnExpressions.getOperands().size() - 1);
        List<?> valueExpressions = null;
        if (operands.get(i) instanceof RexLiteral) {
          RexLiteral literal = (RexLiteral) operands.get(i);
          valueExpressions = literal.getValueAs(List.class);
        } else if (operands.get(i) instanceof RexCall) {
          RexCall call = (RexCall) operands.get(i);
          if (HiveCalciteUtil.isDeterministic(call)) {
            valueExpressions = call.getOperands();
          }
        }
        if (valueExpressions == null) {
          return null;
        }
        for (int j = 0; j < columnExpressions.getOperands().size(); j++) {
          conjuncts.add(rexBuilder.makeCall(
              SqlStdOperatorTable.EQUALS,
              columnExpressions.getOperands().get(j),
              (RexNode) valueExpressions.get(j)));
        }
        if (conjuncts.size() > 1) {
          disjuncts.add(rexBuilder.makeCall(
              SqlStdOperatorTable.AND,
              conjuncts));
        } else {
          disjuncts.add(conjuncts.get(0));
        }
      }
    }
    return disjuncts;
  }
The method tries to rewrite an the operands of an IN function call into
the operands for an OR function call.
For instance:
<pre>
(c) IN ( v1, v2, ...) =&gt; c=v1 || c=v2 || ...
Input: (c, v1, v2, ...)
Output: (c=v1, c=v2, ...)
</pre>
Or:
<pre>
(c,d) IN ( (v1,v2), (v3,v4), ...) =&gt; (c=v1 &amp;&amp; d=v2) || (c=v3 &amp;&amp; d=v4) || ...
Input: ((c,d), (v1,v2), (v3,v4), ...)
Output: (c=v1 &amp;&amp; d=v2, c=v3 &amp;&amp; d=v4, ...)
</pre>

Returns null if the transformation fails, e.g., when non-deterministic
calls are found in the expressions.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/RexNodeConverter.java