zhangbutao commented on code in PR #6247:
URL: https://github.com/apache/hive/pull/6247#discussion_r2641672742
##########
parser/src/java/org/apache/hadoop/hive/ql/parse/FromClauseParser.g:
##########
@@ -235,7 +235,7 @@ databaseName
@init { gParent.pushMsg("database name", state); }
@after { gParent.popMsg(state); }
:
- catalog=identifier DOT db=identifier?
+ catalog=identifier DOT db=identifier
Review Comment:
I think we can simplify it like this:
```
--- a/parser/src/java/org/apache/hadoop/hive/ql/parse/FromClauseParser.g
+++ b/parser/src/java/org/apache/hadoop/hive/ql/parse/FromClauseParser.g
@@ -235,11 +235,8 @@ databaseName
@init { gParent.pushMsg("database name", state); }
@after { gParent.popMsg(state); }
:
- catalog=identifier DOT db=identifier?
- -> ^(TOK_DBNAME $catalog $db)
- |
- db=identifier
- -> ^(TOK_DBNAME $db)
+ (catalog=identifier DOT)? db=identifier
+ -> ^(TOK_DBNAME $catalog? $db)
;
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]