[
https://issues.apache.org/jira/browse/HIVE-27234?focusedWorklogId=860258&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-860258
]
ASF GitHub Bot logged work on HIVE-27234:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 03/May/23 10:04
Start Date: 03/May/23 10:04
Worklog Time Spent: 10m
Work Description: zhangbutao commented on code in PR #4216:
URL: https://github.com/apache/hive/pull/4216#discussion_r1183485755
##########
parser/src/java/org/apache/hadoop/hive/ql/parse/AlterClauseParser.g:
##########
@@ -477,6 +478,34 @@ alterStatementSuffixExecute
-> ^(TOK_ALTERTABLE_EXECUTE KW_SET_CURRENT_SNAPSHOT $snapshotParam)
;
+alterStatementSuffixCreateBranch
+@init { gParent.pushMsg("alter table create branch", state); }
+@after { gParent.popMsg(state); }
+ : KW_CREATE KW_BRANCH branchName=identifier snapshotIdOfBranch?
branchRetain? retentionOfSnapshots?
+ -> ^(TOK_ALTERTABLE_CREATE_BRANCH $branchName snapshotIdOfBranch?
branchRetain? retentionOfSnapshots?)
+ ;
+
+snapshotIdOfBranch
+@init { gParent.pushMsg("alter table create branch as of version", state); }
Review Comment:
My original thought was to be consistent with spark-iceberg syntax. But it
seems more reasonable to be sync with current hive` timet_travel` syntax.
I will be change the syntax and add the syntax `FOR SYSTEM_TIME AS OF`.
The new syntax will be as follows:
```
ALTER TABLE tableName
{CREATE BRANCH branchName [FOR SYSTEM_VERSION AS OF {snapshotId} | FOR
SYSTEM_TIME AS OF {timestamp}]
[RETAIN interval {DAYS | HOURS | MINUTES}]
[WITH SNAPSHOT RETENTION {[num_snapshots SNAPSHOTS] [interval {DAYS | HOURS
| MINUTES}]}]}]
```
Issue Time Tracking
-------------------
Worklog Id: (was: 860258)
Time Spent: 5h 20m (was: 5h 10m)
> Iceberg: CREATE BRANCH SQL implementation
> ------------------------------------------
>
> Key: HIVE-27234
> URL: https://issues.apache.org/jira/browse/HIVE-27234
> Project: Hive
> Issue Type: Sub-task
> Components: Iceberg integration
> Reporter: zhangbutao
> Assignee: zhangbutao
> Priority: Major
> Labels: pull-request-available
> Time Spent: 5h 20m
> Remaining Estimate: 0h
>
> Maybe we can follow spark sql about branch ddl implementation
> [https://github.com/apache/iceberg/pull/6617]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)