protected boolean shouldByPass(Node childNode, Node parentNode) {
    if(parentNode instanceof ASTNode
            && ((ASTNode)parentNode).getType() == HiveParser.TOK_SUBQUERY_EXPR) {
      ASTNode parentOp = (ASTNode)parentNode;
      //subquery either in WHERE <LHS> IN <SUBQUERY> form OR WHERE EXISTS <SUBQUERY> form
      //in first case LHS should not be bypassed
      assert(parentOp.getChildCount() == 2 || parentOp.getChildCount()==3);
      if(parentOp.getChildCount() == 3 && (ASTNode)childNode == parentOp.getChild(2)) {
        return false;
      }
      return true;
    }
    return false;
  }
We should bypass subquery since we have already processed and created logical plan
(in genLogicalPlan) for subquery at this point.
SubQueryExprProcessor will use generated plan and creates appropriate ExprNodeSubQueryDesc.
ql/src/java/org/apache/hadoop/hive/ql/lib/SubqueryExpressionWalker.java