jackye1995 commented on code in PR #6617:
URL: https://github.com/apache/iceberg/pull/6617#discussion_r1073740501


##########
spark/v3.3/spark-extensions/src/main/antlr/org.apache.spark.sql.catalyst.parser.extensions/IcebergSqlExtensions.g4:
##########
@@ -73,6 +73,13 @@ statement
     | ALTER TABLE multipartIdentifier WRITE writeSpec                          
             #setWriteDistributionAndOrdering
     | ALTER TABLE multipartIdentifier SET IDENTIFIER_KW FIELDS fieldList       
             #setIdentifierFields
     | ALTER TABLE multipartIdentifier DROP IDENTIFIER_KW FIELDS fieldList      
             #dropIdentifierFields
+    | ALTER TABLE multipartIdentifier CREATE BRANCH identifier (AS OF VERSION 
snapshotId)?  (snapshotRetentionClause)? (RETAIN snapshotRefRetain 
snapshotRefRetainTimeUnit)?   #createBranch

Review Comment:
   feels more natural for the `RETAIN` clause to be before the 
`snapshotRetentionClause`? Because clauses like:
   
   ```
   CREATE BRANCH branch AS OF VERSION 12345 
   WITH SNAPSHOT RETENTION 2 SNAPSHOTS 2 DAYS
   RETAIN 2 DAYS
   ```
   
   vs 
   
   ```
   CREATE BRANCH branch AS OF VERSION 12345 
   RETAIN 2 DAYS
   WITH SNAPSHOT RETENTION 2 SNAPSHOTS 2 DAYS
   ```
   
   Making `RETAIN` after `WITH SNAPSHOT RETENTION` makes me feel a bit lost 
about what that clause is doing. By moving it closer to `CREATE BRANCH`, it is 
clearer that `RETAIN` is describing expiration of the branch.
   
   What do you think?



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to