Skip to content

Conversation

@satishkotha
Copy link
Owner

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 do commit in 2places - BaseActionCommitExecutor or HoodieSparkSqlWriter. We need to change both places. HoodieSparkSqlWriter creates commit file from RDD and doesn't know about commit vs replace difference today. We have to introduce additional complexity here to make it write ".replace" files
  2. All post commit actions work on top of HoodieCommitMetadata. For replace, we want to choose different metadata format. Making replace subclass of HoodieCommitMetadata is not ideal.
  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. 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 apache#4,apache#5.

Verify this pull request

(Please pick either of the following options)

This pull request is a trivial rework / code cleanup without any test coverage.

(or)

This pull request is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end.
  • Added HoodieClientWriteTest to verify the change.
  • Manually verified the change by running a job locally.

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.

@satishkotha
Copy link
Owner Author

apache#2048 in upstream

@satishkotha satishkotha closed this Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants