satishkotha opened a new pull request #2048:
URL: https://github.com/apache/hudi/pull/2048


   
   ## What is the purpose of the pull request
   I am following up on feedback apache#1859, we want to make replace a top 
level action. This is WIP, but publishing to give a high level idea on changes 
required.
   
   ## Brief change log
   
   There are multiple challenges in making replace top level action:
   
   1. In the write path, we create .commit in 2places - 
BaseActionCommitExecutor or HoodieSparkSqlWriter. We need to change both places 
create  .replace file. 
   2. All post commit actions work on top of HoodieCommitMetadata. For now 
replace is also using same class to keep the change simple. We can split 
HoodieCommitMetadata into class hierarchy (not sure how json serialization 
works with inheritance) or discuss other alternatives
   3. There are many assumptions in the code to say commit action type is tied 
to table type. For example, action type can only be either '.commit' or 
'.deltacommit'. 
[here](https://github.com/apache/hudi/blob/master/hudi-common/src/main/java/org/apache/hudi/common/table/HoodieTableMetaClient.java#L474).
 Changing this to add replace seemed error prone and tedious. we may have to 
add better abstractions here.
   4. The way we identify if a parquet file is valid is by checking if theres a 
corresponding '.commit' file. If we just create .replace file, we have to 
change lot of places to make sure new files created by replace are used.
   5. Everywhere, we try to invoke 'getCommitsTimeline'/'filterCommits', we 
need to review and make sure caller can handle replace actions. OR create new 
methods and refactor all invocations of getCommitsTimeline call new methods.
   
   I made most of the changes for #1,2,3 above. Need to discuss if this is the 
right approach and extend it to 4,5.
   
   ## Verify this pull request
   This change added tests. Verified basic actions using quick start and docker 
setup. Adding more tests in progress. But wanted to get feedback on high level 
approach.
   
   This is an example .hoodie folder from quick start setup:
   -rw-r--r--  1 satishkotha  wheel  1933 Aug 27 16:39 20200827163904.commit
   -rw-r--r--  1 satishkotha  wheel     0 Aug 27 16:39 
20200827163904.commit.requested
   -rw-r--r--  1 satishkotha  wheel  1015 Aug 27 16:39 20200827163904.inflight
   -rw-r--r--  1 satishkotha  wheel  2610 Aug 27 16:39 20200827163927.replace
   -rw-r--r--  1 satishkotha  wheel  1024 Aug 27 16:39 
20200827163927.replace.inflight
   -rw-r--r--  1 satishkotha  wheel     0 Aug 27 16:39 
20200827163927.replace.requested
   drwxr-xr-x  2 satishkotha  wheel    64 Aug 27 16:39 archived
   -rw-r--r--  1 satishkotha  wheel   235 Aug 27 16:39 hoodie.properties
   
   
   
   ## 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:
[email protected]


Reply via email to