public final HiveParser.createViewStatement_return createViewStatement() throws RecognitionException {
		HiveParser.createViewStatement_return retval = new HiveParser.createViewStatement_return();
		retval.start = input.LT(1);

		CommonTree root_0 = null;

		Token KW_CREATE514=null;
		Token KW_VIEW516=null;
		Token LPAREN518=null;
		Token RPAREN520=null;
		Token KW_AS524=null;
		ParserRuleReturnScope name =null;
		ParserRuleReturnScope orReplace515 =null;
		ParserRuleReturnScope ifNotExists517 =null;
		ParserRuleReturnScope columnNameCommentList519 =null;
		ParserRuleReturnScope tableComment521 =null;
		ParserRuleReturnScope viewPartition522 =null;
		ParserRuleReturnScope tablePropertiesPrefixed523 =null;
		ParserRuleReturnScope selectStatement525 =null;

		CommonTree KW_CREATE514_tree=null;
		CommonTree KW_VIEW516_tree=null;
		CommonTree LPAREN518_tree=null;
		CommonTree RPAREN520_tree=null;
		CommonTree KW_AS524_tree=null;
		RewriteRuleTokenStream stream_KW_AS=new RewriteRuleTokenStream(adaptor,"token KW_AS");
		RewriteRuleTokenStream stream_KW_CREATE=new RewriteRuleTokenStream(adaptor,"token KW_CREATE");
		RewriteRuleTokenStream stream_RPAREN=new RewriteRuleTokenStream(adaptor,"token RPAREN");
		RewriteRuleTokenStream stream_KW_VIEW=new RewriteRuleTokenStream(adaptor,"token KW_VIEW");
		RewriteRuleTokenStream stream_LPAREN=new RewriteRuleTokenStream(adaptor,"token LPAREN");
		RewriteRuleSubtreeStream stream_selectStatement=new RewriteRuleSubtreeStream(adaptor,"rule selectStatement");
		RewriteRuleSubtreeStream stream_columnNameCommentList=new RewriteRuleSubtreeStream(adaptor,"rule columnNameCommentList");
		RewriteRuleSubtreeStream stream_tableName=new RewriteRuleSubtreeStream(adaptor,"rule tableName");
		RewriteRuleSubtreeStream stream_orReplace=new RewriteRuleSubtreeStream(adaptor,"rule orReplace");
		RewriteRuleSubtreeStream stream_tableComment=new RewriteRuleSubtreeStream(adaptor,"rule tableComment");
		RewriteRuleSubtreeStream stream_tablePropertiesPrefixed=new RewriteRuleSubtreeStream(adaptor,"rule tablePropertiesPrefixed");
		RewriteRuleSubtreeStream stream_viewPartition=new RewriteRuleSubtreeStream(adaptor,"rule viewPartition");
		RewriteRuleSubtreeStream stream_ifNotExists=new RewriteRuleSubtreeStream(adaptor,"rule ifNotExists");


		    msgs.push("create view statement");

		try {
			// HiveParser.g:1429:5: ( KW_CREATE ( orReplace )? KW_VIEW ( ifNotExists )? name= tableName ( LPAREN columnNameCommentList RPAREN )? ( tableComment )? ( viewPartition )? ( tablePropertiesPrefixed )? KW_AS selectStatement -> ^( TOK_CREATEVIEW $name ( orReplace )? ( ifNotExists )? ( columnNameCommentList )? ( tableComment )? ( viewPartition )? ( tablePropertiesPrefixed )? selectStatement ) )
			// HiveParser.g:1429:7: KW_CREATE ( orReplace )? KW_VIEW ( ifNotExists )? name= tableName ( LPAREN columnNameCommentList RPAREN )? ( tableComment )? ( viewPartition )? ( tablePropertiesPrefixed )? KW_AS selectStatement
			{
			KW_CREATE514=(Token)match(input,KW_CREATE,FOLLOW_KW_CREATE_in_createViewStatement8059);  
			stream_KW_CREATE.add(KW_CREATE514);

			// HiveParser.g:1429:17: ( orReplace )?
			int alt144=2;
			int LA144_0 = input.LA(1);
			if ( (LA144_0==KW_OR) ) {
				alt144=1;
			}
			switch (alt144) {
				case 1 :
					// HiveParser.g:1429:18: orReplace
					{
					pushFollow(FOLLOW_orReplace_in_createViewStatement8062);
					orReplace515=orReplace();
					state._fsp--;

					stream_orReplace.add(orReplace515.getTree());
					}
					break;

			}

			KW_VIEW516=(Token)match(input,KW_VIEW,FOLLOW_KW_VIEW_in_createViewStatement8066);  
			stream_KW_VIEW.add(KW_VIEW516);

			// HiveParser.g:1429:38: ( ifNotExists )?
			int alt145=2;
			int LA145_0 = input.LA(1);
			if ( (LA145_0==KW_IF) ) {
				alt145=1;
			}
			switch (alt145) {
				case 1 :
					// HiveParser.g:1429:39: ifNotExists
					{
					pushFollow(FOLLOW_ifNotExists_in_createViewStatement8069);
					ifNotExists517=ifNotExists();
					state._fsp--;

					stream_ifNotExists.add(ifNotExists517.getTree());
					}
					break;

			}

			pushFollow(FOLLOW_tableName_in_createViewStatement8075);
			name=tableName();
			state._fsp--;

			stream_tableName.add(name.getTree());
			// HiveParser.g:1430:9: ( LPAREN columnNameCommentList RPAREN )?
			int alt146=2;
			int LA146_0 = input.LA(1);
			if ( (LA146_0==LPAREN) ) {
				alt146=1;
			}
			switch (alt146) {
				case 1 :
					// HiveParser.g:1430:10: LPAREN columnNameCommentList RPAREN
					{
					LPAREN518=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_createViewStatement8086);  
					stream_LPAREN.add(LPAREN518);

					pushFollow(FOLLOW_columnNameCommentList_in_createViewStatement8088);
					columnNameCommentList519=columnNameCommentList();
					state._fsp--;

					stream_columnNameCommentList.add(columnNameCommentList519.getTree());
					RPAREN520=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_createViewStatement8090);  
					stream_RPAREN.add(RPAREN520);

					}
					break;

			}

			// HiveParser.g:1430:48: ( tableComment )?
			int alt147=2;
			int LA147_0 = input.LA(1);
			if ( (LA147_0==KW_COMMENT) ) {
				alt147=1;
			}
			switch (alt147) {
				case 1 :
					// HiveParser.g:1430:48: tableComment
					{
					pushFollow(FOLLOW_tableComment_in_createViewStatement8094);
					tableComment521=tableComment();
					state._fsp--;

					stream_tableComment.add(tableComment521.getTree());
					}
					break;

			}

			// HiveParser.g:1430:62: ( viewPartition )?
			int alt148=2;
			int LA148_0 = input.LA(1);
			if ( (LA148_0==KW_PARTITIONED) ) {
				alt148=1;
			}
			switch (alt148) {
				case 1 :
					// HiveParser.g:1430:62: viewPartition
					{
					pushFollow(FOLLOW_viewPartition_in_createViewStatement8097);
					viewPartition522=viewPartition();
					state._fsp--;

					stream_viewPartition.add(viewPartition522.getTree());
					}
					break;

			}

			// HiveParser.g:1431:9: ( tablePropertiesPrefixed )?
			int alt149=2;
			int LA149_0 = input.LA(1);
			if ( (LA149_0==KW_TBLPROPERTIES) ) {
				alt149=1;
			}
			switch (alt149) {
				case 1 :
					// HiveParser.g:1431:9: tablePropertiesPrefixed
					{
					pushFollow(FOLLOW_tablePropertiesPrefixed_in_createViewStatement8108);
					tablePropertiesPrefixed523=tablePropertiesPrefixed();
					state._fsp--;

					stream_tablePropertiesPrefixed.add(tablePropertiesPrefixed523.getTree());
					}
					break;

			}

			KW_AS524=(Token)match(input,KW_AS,FOLLOW_KW_AS_in_createViewStatement8119);  
			stream_KW_AS.add(KW_AS524);

			pushFollow(FOLLOW_selectStatement_in_createViewStatement8129);
			selectStatement525=selectStatement();
			state._fsp--;

			stream_selectStatement.add(selectStatement525.getTree());
			// AST REWRITE
			// elements: viewPartition, selectStatement, columnNameCommentList, name, ifNotExists, orReplace, tableComment, tablePropertiesPrefixed
			// token labels: 
			// rule labels: retval, name
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);
			RewriteRuleSubtreeStream stream_name=new RewriteRuleSubtreeStream(adaptor,"rule name",name!=null?name.getTree():null);

			root_0 = (CommonTree)adaptor.nil();
			// 1434:5: -> ^( TOK_CREATEVIEW $name ( orReplace )? ( ifNotExists )? ( columnNameCommentList )? ( tableComment )? ( viewPartition )? ( tablePropertiesPrefixed )? selectStatement )
			{
				// HiveParser.g:1434:8: ^( TOK_CREATEVIEW $name ( orReplace )? ( ifNotExists )? ( columnNameCommentList )? ( tableComment )? ( viewPartition )? ( tablePropertiesPrefixed )? selectStatement )
				{
				CommonTree root_1 = (CommonTree)adaptor.nil();
				root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TOK_CREATEVIEW, "TOK_CREATEVIEW"), root_1);
				adaptor.addChild(root_1, stream_name.nextTree());
				// HiveParser.g:1434:31: ( orReplace )?
				if ( stream_orReplace.hasNext() ) {
					adaptor.addChild(root_1, stream_orReplace.nextTree());
				}
				stream_orReplace.reset();

				// HiveParser.g:1435:10: ( ifNotExists )?
				if ( stream_ifNotExists.hasNext() ) {
					adaptor.addChild(root_1, stream_ifNotExists.nextTree());
				}
				stream_ifNotExists.reset();

				// HiveParser.g:1436:10: ( columnNameCommentList )?
				if ( stream_columnNameCommentList.hasNext() ) {
					adaptor.addChild(root_1, stream_columnNameCommentList.nextTree());
				}
				stream_columnNameCommentList.reset();

				// HiveParser.g:1437:10: ( tableComment )?
				if ( stream_tableComment.hasNext() ) {
					adaptor.addChild(root_1, stream_tableComment.nextTree());
				}
				stream_tableComment.reset();

				// HiveParser.g:1438:10: ( viewPartition )?
				if ( stream_viewPartition.hasNext() ) {
					adaptor.addChild(root_1, stream_viewPartition.nextTree());
				}
				stream_viewPartition.reset();

				// HiveParser.g:1439:10: ( tablePropertiesPrefixed )?
				if ( stream_tablePropertiesPrefixed.hasNext() ) {
					adaptor.addChild(root_1, stream_tablePropertiesPrefixed.nextTree());
				}
				stream_tablePropertiesPrefixed.reset();

				adaptor.addChild(root_1, stream_selectStatement.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

			 msgs.pop(); 
		}

		catch (RecognitionException e) {
		 reportError(e);
		  throw e;
		}

		finally {
			// do for sure before leaving
		}
		return retval;
	}