Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HUDI-8409] Add test to ensure merge mode during upgrade and downgrade #13009

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

linliu-code
Copy link
Contributor

@linliu-code linliu-code commented Mar 20, 2025

Change Logs

  1. Update the merge mode upgrade logic.
  2. Add unit test to the specific logic.
  3. Add functional test for the overall flow.

Impact

Clean and clear verification on merge mode during table version change.

Risk level (write none, low medium or high below)

Medium.

Documentation Update

Describe any necessary documentation update if there is any new feature, config, or user-facing change. If not, put "none".

  • The config description must be updated if new configs are added or the default value of the configs are changed
  • Any new feature or user-facing change requires updating the Hudi website. Please create a Jira ticket, attach the
    ticket number here and follow the instruction to make
    changes to the website.

Contributor's checklist

  • Read through contributor's guide
  • Change Logs and Impact were stated clearly
  • Adequate tests were added if applicable
  • CI passed

@github-actions github-actions bot added the size:M PR with lines of changes in (100, 300] label Mar 21, 2025
@github-actions github-actions bot added size:L PR with lines of changes in (300, 1000] and removed size:M PR with lines of changes in (100, 300] labels Mar 21, 2025
if (tableConfig.getPayloadClass() != null
&& tableConfig.getPayloadClass().equals(OverwriteWithLatestAvroPayload.class.getName())) {
if (HoodieTableType.COPY_ON_WRITE == tableConfig.getTableType()) {
if (tableConfig.getPayloadClass() != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add unit tests on these logic in TestSevenToEightUpgradeHandler besides functional tests? Also, simplify the functional tests because those are time-consuming.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sg. We have some unit tests for the overall upgradehandler logic. let me add some unit tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unit test is added.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. I am also thinking if we really need a functional test?
why can't we add tests directly against upgrade handler. validate the table config props before and after upgrade and be done with it.

@linliu-code linliu-code force-pushed the HUDI-8409 branch 2 times, most recently from 0de0635 to 7348332 Compare March 22, 2025 01:03
(10, "5", "rider-E", "driver-E", 17.85, "i"),
(10, "3", "rider-C", "driver-C", 33.9, "i"),
(20, "6", "rider-Z", "driver-Z", 27.7, "i"))
val expectedCommitTimeBased: Seq[(Int, String, String, String, Double, String)] = Seq(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will make commit time and event time results different.

@linliu-code linliu-code requested a review from yihua March 22, 2025 01:05
if (tableConfig.getPayloadClass() != null
&& tableConfig.getPayloadClass().equals(OverwriteWithLatestAvroPayload.class.getName())) {
if (HoodieTableType.COPY_ON_WRITE == tableConfig.getTableType()) {
if (tableConfig.getPayloadClass() != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. I am also thinking if we really need a functional test?
why can't we add tests directly against upgrade handler. validate the table config props before and after upgrade and be done with it.

if (HoodieTableType.COPY_ON_WRITE == tableConfig.getTableType()) {
if (tableConfig.getPayloadClass() != null) {
if (tableConfig.getPayloadClass().equals(OverwriteWithLatestAvroPayload.class.getName())) {
if (HoodieTableType.COPY_ON_WRITE == tableConfig.getTableType()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets first align on all diff combinations and whats expected behavior during upgrade and downgrade before going ahead w/ the patch. we can sync up f2f on this

@github-actions github-actions bot added size:M PR with lines of changes in (100, 300] and removed size:L PR with lines of changes in (300, 1000] labels Mar 25, 2025
@hudi-bot
Copy link

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

Copy link
Contributor

@yihua yihua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocked on my review and revision

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:M PR with lines of changes in (100, 300]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants