From 83d33cec25697f751695bad109fa6662bde09f44 Mon Sep 17 00:00:00 2001 From: wangbo <506340561@qq.com> Date: Fri, 14 Feb 2020 11:49:14 +0800 Subject: [PATCH] [Syntax] Fix alter rollup stmt Shift/Reduce conflict (#2897) --- fe/src/main/cup/sql_parser.cup | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/fe/src/main/cup/sql_parser.cup b/fe/src/main/cup/sql_parser.cup index bfc5bf3ed7..a2e2de6c46 100644 --- a/fe/src/main/cup/sql_parser.cup +++ b/fe/src/main/cup/sql_parser.cup @@ -631,6 +631,14 @@ alter_stmt ::= {: RESULT = new AlterTableStmt(tbl, clauses); :} + | KW_ALTER KW_TABLE table_name:tbl KW_ADD KW_ROLLUP add_rollup_clause_list:clauses + {: + RESULT = new AlterTableStmt(tbl, clauses); + :} + | KW_ALTER KW_TABLE table_name:tbl KW_DROP KW_ROLLUP drop_rollup_clause_list:clauses + {: + RESULT = new AlterTableStmt(tbl, clauses); + :} | KW_ALTER KW_VIEW table_name:tbl opt_col_with_comment_list:columns KW_AS query_stmt:view_def {: @@ -714,15 +722,7 @@ drop_rollup_clause_list ::= ; alter_table_clause_list ::= - KW_ADD KW_ROLLUP add_rollup_clause_list:list - {: - RESULT = list; - :} - | KW_DROP KW_ROLLUP drop_rollup_clause_list:list - {: - RESULT = list; - :} - | alter_table_clause:clause + alter_table_clause:clause {: RESULT = Lists.newArrayList(clause); :}