difin commented on code in PR #5889: URL: https://github.com/apache/hive/pull/5889#discussion_r2166764229
########## parser/src/java/org/apache/hadoop/hive/ql/parse/AlterClauseParser.g: ########## @@ -558,13 +558,42 @@ alterStatementSuffixReplaceTag -> ^(TOK_ALTERTABLE_REPLACE_SNAPSHOTREF KW_TAG $sourceBranch $snapshotId refRetain?) ; +dropBranchStatement +@init { gParent.pushMsg("alter table drop branch (if exists) branchName", state); } +@after { gParent.popMsg(state); } + : KW_DROP KW_BRANCH ifExists? branchName=identifier KW_FROM tableName + -> ^(TOK_ALTERTABLE tableName + ^(TOK_ALTERTABLE_DROP_BRANCH ifExists? $branchName) + ) + ; + alterStatementSuffixDropBranch @init { gParent.pushMsg("alter table drop branch (if exists) branchName", state); } @after { gParent.popMsg(state); } : KW_DROP KW_BRANCH ifExists? branchName=identifier -> ^(TOK_ALTERTABLE_DROP_BRANCH ifExists? $branchName) ; +createBranchStatement +@init { gParent.pushMsg("create branch statement", state); } +@after { gParent.popMsg(state); } + : KW_CREATE KW_BRANCH ifNotExists? branchName=identifier KW_FROM tableName + snapshotIdOfRef? refRetain? retentionOfSnapshots? + -> ^(TOK_ALTERTABLE tableName + ^(TOK_ALTERTABLE_CREATE_BRANCH $branchName ifNotExists? snapshotIdOfRef? refRetain? retentionOfSnapshots?) Review Comment: This part of the syntax seem to be not covered by the new q-test that you introduced: `ifNotExists? snapshotIdOfRef? refRetain? retentionOfSnapshots?`, should they be tested? This can be tested by junit tests like `TestParseOptimizeTable` not necessary q-test. -- 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: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org