protected boolean isInsertInto(QBParseInfo qbp, String dest) {
    // get the destination and check if it is TABLE
    if(qbp == null || dest == null ) {
      return false;
    }
    ASTNode destNode = qbp.getDestForClause(dest);
    return destNode != null && destNode.getType() == HiveParser.TOK_TAB;
  }
This method figures out if current AST is for INSERT INTO
@param qbp qbParseInfo
@param dest destination clause
@return true or false
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java