@Override
    public RexNode visitCall(final RexCall call) {
      switch (call.getKind()) {
      case SEARCH: {
        return new SearchTransformer<>(rexBuilder, call).transform().accept(this);
      }
      case AND: {
        boolean[] update = {false};
        List<RexNode> newOperands = visitList(call.operands, update);
        if (update[0]) {
          return RexUtil.composeConjunction(rexBuilder, newOperands);
        }
        return call;
      }
      case OR: {
        boolean[] update = {false};
        List<RexNode> newOperands = visitList(call.operands, update);
        if (update[0]) {
          return RexUtil.composeDisjunction(rexBuilder, newOperands);
        }
        return call;
      }
      case BETWEEN: {
        List<RexNode> newOperands = RexNodeConverter.rewriteBetweenChildren(
            call.getOperands(), rexBuilder);
        modified = true;
        if (call.getOperands().get(0).isAlwaysTrue()) {
          return rexBuilder.makeCall(SqlStdOperatorTable.OR, newOperands);
        }
        return rexBuilder.makeCall(SqlStdOperatorTable.AND, newOperands);
      }
      default:
        if (HiveIn.INSTANCE.equals(call.op)) {
          List<RexNode> newOperands = RexNodeConverter.transformInToOrOperands(call.getOperands(), rexBuilder);
          if (newOperands == null) {
            // We could not execute transformation, return expression
            return call;
          }
          modified = true;
          if (newOperands.size() > 1) {
            return rexBuilder.makeCall(SqlStdOperatorTable.OR, newOperands);
          }
          return newOperands.get(0);
        }
        return super.visitCall(call);
      }
    }
Class that transforms IN/BETWEEN clauses in an expression.
If any call is modified, the modified flag will be set to
true after its execution.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveInBetweenExpandRule.java