@Override
    public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx,
        Object... nodeOutputs) throws SemanticException {
      ExprWalkerInfo ctx = (ExprWalkerInfo) procCtx;
      String alias = null;
      ExprNodeGenericFuncDesc expr = (ExprNodeGenericFuncDesc) nd;

      if (!FunctionRegistry.isConsistentWithinQuery(expr.getGenericUDF())) {
        // this GenericUDF can't be pushed down
        ExprInfo exprInfo = ctx.addOrGetExprInfo(expr);
        exprInfo.isCandidate = false;
        ctx.setDeterministic(false);
        return false;
      }

      boolean isCandidate = true;
      for (int i = 0; i < nd.getChildren().size(); i++) {
        ExprNodeDesc ch = (ExprNodeDesc) nd.getChildren().get(i);
        ExprInfo chExprInfo = ctx.getExprInfo(ch);
        ExprNodeDesc newCh = chExprInfo != null ? chExprInfo.convertedExpr : null;
        if (newCh != null) {
          expr.getChildren().set(i, newCh);
          ch = newCh;
          chExprInfo = ctx.getExprInfo(ch);
        }

        String chAlias;
        if (chExprInfo != null) {
          chAlias = chExprInfo.alias;
          isCandidate = isCandidate && chExprInfo.isCandidate;
        } else {
          chAlias = null;
          isCandidate = false;
        }
        // need to iterate through all children even if one is found to be not a
        // candidate
        // in case if the other children could be individually pushed up
        if (isCandidate && chAlias != null) {
          if (alias == null) {
            alias = chAlias;
          } else if (!chAlias.equalsIgnoreCase(alias)) {
            isCandidate = false;
          }
        }

        if (!isCandidate) {
          break;
        }
      }
      ExprInfo exprInfo = ctx.addOrGetExprInfo(expr);
      if (alias != null) {
        exprInfo.alias = alias;
      }
      exprInfo.isCandidate = isCandidate;
      return isCandidate;
    }
If all children are candidates and refer only to one table alias then this
expr is a candidate else it is not a candidate but its children could be
final candidates.
ql/src/java/org/apache/hadoop/hive/ql/ppd/ExprWalkerProcFactory.java