tanmayrauth opened a new issue, #957:
URL: https://github.com/apache/iceberg-go/issues/957

   ### Feature Request / Improvement
   
   ## Summary                                                                   
                                                                                
                                                                                
                                                                   
                                                               
     Tracking issue for adding maintenance commands to the `iceberg` CLI. 
Design doc: [[link to 
doc](https://docs.google.com/document/d/1PHX2GAxUTuVL9rfizWuzKG5QFt0D8Mi-k76ziFsHjf4/edit?usp=sharing)].
                                                                                
                                                                                
                                                 
                                                               
     This would make iceberg-go the first Iceberg implementation with a 
maintenance CLI,  Spark uses `CALL` procedures, pyiceberg's CLI is read-only.   
                                                                                
                                                                             
                                                               
     **11 commands** across 6 work items:                                       
                                                                                
                                                                                
                                                                     
                                                               
     ## Plan                                                                    
                                                                                
                                                                                
                                                                     
                                                               
     ### 1. Shared infrastructure                                               
                                                                                
                                                                                
                                                                     
     - [ ] Duration parser (`7d` → `168h`, days only — weeks/months ambiguous)
     - [ ] `--yes` confirmation prompt (TTY-aware; errors in non-interactive 
mode without `--yes`)                                                           
                                                                                
                                                                        
     - [ ] Dry-run output contract (`[DRY RUN]` prefix in text, `"dry_run": 
true` in JSON, exit 0)                                                          
                                                                                
                                                                         
     - [ ] `--output json|text` support for all new commands                    
                                                                                
                                                                                
                                                                     
                                                                                
                                                                                
                                                                                
                                                                     
     ### 2. Read-only commands `good-first-issue`                               
                                                                                
                                                                                
                                                                     
     - [ ] `info TABLE`                                                         
                                                                                
                                                                                
                                                                     
     - [ ] `snapshots TABLE`                                                    
                                                                                
                                                                                
                                                                     
     - [ ] `refs TABLE [--type REFTYPE]`                                        
                                                                                
                                                                                
                                                                     
     - [ ] `partition-stats TABLE [--snapshot-id ID] [--all]`                   
                                                                                
                                                                                
                                                                     
     - [ ] `schema TABLE --show-defaults`                                       
                                                                                
                                                                                
                                                                     
                                                                                
                                                                                
                                                                                
                                                                     
     ### 3. Snapshot maintenance                                                
                                                                                
                                                                                
                                                                     
     - [ ] `expire-snapshots TABLE [--older-than DURATION] [--retain-last N] 
[--dry-run] [--yes]`                                                            
                                                                                
                                                                        
     - [ ] `clean-orphan-files TABLE [--older-than DURATION] [--dry-run] 
[--yes] [--location PATH]`                                                      
                                                                                
                                                                            
                                                                                
                                                                                
                                                                                
                                                                     
     ### 4. Rollback                                                            
                                                                                
                                                                                
                                                                     
     - [ ] `rollback TABLE --snapshot-id ID [--yes]`                            
                                                                                
                                                                                
                                                                     
                                                                                
                                                                                
                                                                                
                                                                     
     ### 5. Format upgrade                                                      
                                                                                
                                                                                
                                                                     
     - [ ] `upgrade TABLE FORMAT_VERSION [--dry-run] [--yes]`                   
                                                                                
                                                                                
                                                                     
                                                                                
                                                                                
                                                                                
                                                                     
     ### 6. Ref management                                                      
                                                                                
                                                                                
                                                                     
     - [ ] `branch create TABLE NAME [--snapshot-id ID] [--max-ref-age 
DURATION] [--max-snapshot-age DURATION] [--min-snapshots-to-keep N]`            
                                                                                
                                                                              
     - [ ] `tag create TABLE NAME [--snapshot-id ID] [--max-ref-age DURATION]`  
                                                                                
                                                                                
                                                                     
                                                                                
                                                                                
                                                                                
                                                                     
     ## Testing                                                                 
                                                                                
                                                                                
                                                                     
                                                                                
                                                                                
                                                                                
                                                                     
     - **Shared infra**: table-driven unit tests for duration parser, output 
formatters                                                                      
                                                                                
                                                                        
     - **Read-only commands**: constructed metadata fixtures, no catalog needed
     - **Write commands**: integration tests against Docker REST catalog        
                                                                                
                                                                                
                                                                     
     - **Dry-run**: verify no catalog commit occurs, output includes dry-run 
marker                                                                          
                                                                                
                                                                        
     - **Confirmation**: verify `--yes` skips prompt, non-TTY without `--yes` 
errors, interactive "n" aborts                                                  
                                                                                
                                                                       
                                                                                
                                                                                
                                                                                
                                                                     
     ## Deferred (follow-up issues)                                             
                                                                                
                                                                                
                                                                     
     - `branch delete` / `tag delete`                                           
                                                                                
                                                                                
                                                                     
     - `rollback --timestamp` / `rollback --branch`                             
                                                                                
                                                                                
                                                                     
     - `expire-snapshots --dry-run` file-level impact                           
                                                                                
                                                                                
                                                                     
     - `snapshots --limit N`  


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

Reply via email to