You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2020/01/09 09:46:39 UTC

[GitHub] [incubator-hudi] leesf opened a new pull request #1201: [HUDI-248] CLI doesn't allow rolling back a Delta commit

leesf opened a new pull request #1201: [HUDI-248] CLI doesn't allow rolling back a Delta commit
URL: https://github.com/apache/incubator-hudi/pull/1201
 
 
   ## *Tips*
   - *Thank you very much for contributing to Apache Hudi.*
   - *Please review https://hudi.apache.org/contributing.html before opening a pull request.*
   
   ## What is the purpose of the pull request
   
   Allow CLI support rollback a delta commit.
   
   ## Brief change log
   
   - Modify CommitsCommand.java
   
   ## Verify this pull request
   
   This change added tests and can be verified as follows:
   
   *(example:)*
   
     - *Generate a MOR hudi table.*
     - *Use CLI to connect to the table.*
     - *commit rollback --commit xxx.*
   
   ## Committer checklist
   
    - [ ] Has a corresponding JIRA in PR title & commit
    
    - [ ] Commit message is descriptive of the change
    
    - [ ] CI is green
   
    - [ ] Necessary doc changes done or have another open PR
          
    - [ ] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-hudi] n3nash merged pull request #1201: [HUDI-248] CLI doesn't allow rolling back a Delta commit

Posted by GitBox <gi...@apache.org>.
n3nash merged pull request #1201: [HUDI-248] CLI doesn't allow rolling back a Delta commit
URL: https://github.com/apache/incubator-hudi/pull/1201
 
 
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-hudi] leesf commented on issue #1201: [HUDI-248] CLI doesn't allow rolling back a Delta commit

Posted by GitBox <gi...@apache.org>.
leesf commented on issue #1201: [HUDI-248] CLI doesn't allow rolling back a Delta commit
URL: https://github.com/apache/incubator-hudi/pull/1201#issuecomment-572868372
 
 
   @n3nash Thanks for your review, addressed the comment.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-hudi] n3nash commented on a change in pull request #1201: [HUDI-248] CLI doesn't allow rolling back a Delta commit

Posted by GitBox <gi...@apache.org>.
n3nash commented on a change in pull request #1201: [HUDI-248] CLI doesn't allow rolling back a Delta commit
URL: https://github.com/apache/incubator-hudi/pull/1201#discussion_r365045316
 
 

 ##########
 File path: hudi-cli/src/main/java/org/apache/hudi/cli/commands/CommitsCommand.java
 ##########
 @@ -96,7 +98,15 @@ public String rollbackCommit(@CliOption(key = {"commit"}, help = "Commit to roll
       throws Exception {
     HoodieActiveTimeline activeTimeline = HoodieCLI.getTableMetaClient().getActiveTimeline();
     HoodieTimeline timeline = activeTimeline.getCommitsTimeline().filterCompletedInstants();
-    HoodieInstant commitInstant = new HoodieInstant(false, HoodieTimeline.COMMIT_ACTION, commitTime);
+    HoodieTableType tableType = HoodieCLI.getTableMetaClient().getTableType();
+    HoodieInstant commitInstant;
 
 Review comment:
   A MergeOnRead table has both DELTA_COMMIT and COMMIT. The best way to do this would be : 
   
   instant = activeTimeline.getCommitsTimeline().filterCompletedInstants().filter(instant.getTimestamp.equals(commitTime)
   Use that instant (which should have the action populated) and you can remove the if else..

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services