public static List<RexNode> rewriteBetweenChildren(List<RexNode> childRexNodeLst,
      RexBuilder rexBuilder) {
    final List<RexNode> convertedChildList = Lists.newArrayList();
    SqlBinaryOperator cmpOp;
    if (childRexNodeLst.get(0).isAlwaysTrue()) {
      cmpOp = SqlStdOperatorTable.GREATER_THAN;
    } else {
      cmpOp = SqlStdOperatorTable.LESS_THAN_OR_EQUAL;
    }
    RexNode op = childRexNodeLst.get(1);
    RexNode rangeL = childRexNodeLst.get(2);
    RexNode rangeH = childRexNodeLst.get(3);
    convertedChildList.add(rexBuilder.makeCall(cmpOp, rangeL, op));
    convertedChildList.add(rexBuilder.makeCall(cmpOp, op, rangeH));
    return convertedChildList;
  }
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