diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/FromClauseParser.g b/ql/src/java/org/apache/hadoop/hive/ql/parse/FromClauseParser.g index f8adb38..c40da67 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/parse/FromClauseParser.g +++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/FromClauseParser.g @@ -93,14 +93,13 @@ joinSource uniqueJoinSource @init { gParent.pushMsg("unique join source", state); } @after { gParent.popMsg(state); } - : KW_PRESERVE? fromSource uniqueJoinExpr + : KW_PRESERVE? uniqueJoinTableSource uniqueJoinExpr ; uniqueJoinExpr @init { gParent.pushMsg("unique join expression list", state); } @after { gParent.popMsg(state); } - : LPAREN e1+=expression (COMMA e1+=expression)* RPAREN - -> ^(TOK_EXPLIST $e1*) + : LPAREN! expressionList RPAREN! ; uniqueJoinToken @@ -187,15 +186,17 @@ tableSample tableSource @init { gParent.pushMsg("table source", state); } @after { gParent.popMsg(state); } - : tabname=tableName - ((tableProperties) => props=tableProperties)? - ((tableSample) => ts=tableSample)? - ((KW_AS) => (KW_AS alias=identifier) - | - (identifier) => (alias=identifier))? + : tabname=tableName props=tableProperties? ts=tableSample? (KW_AS? alias=identifier)? -> ^(TOK_TABREF $tabname $props? $ts? $alias?) ; +uniqueJoinTableSource +@init { gParent.pushMsg("unique join table source", state); } +@after { gParent.popMsg(state); } + : tabname=tableName (KW_AS? alias=identifier)? + -> ^(TOK_TABREF $tabname $alias?) + ; + tableName @init { gParent.pushMsg("table name", state); } @after { gParent.popMsg(state); }