private static boolean checkForStatefulFunctions(List<ExprNodeDesc> list) {
    for (ExprNodeDesc node : list) {
      if (node instanceof ExprNodeGenericFuncDesc) {
        GenericUDF nodeUDF = ((ExprNodeGenericFuncDesc) node).getGenericUDF();
        // Stateful?
        if (FunctionRegistry.isStateful(nodeUDF)) {
          return true;
        }
        if (node.getChildren() != null && !node.getChildren().isEmpty() &&
            checkForStatefulFunctions(node.getChildren())) {
          return true;
        }
      }
    }
    return false;
  }
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