ayushtkn commented on code in PR #5889:
URL: https://github.com/apache/hive/pull/5889#discussion_r2167310999


##########
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:
   I have added more tests as you suggested



-- 
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

Reply via email to