Skip to content

[HUDI-8418] Throw an error if the table configs of record merge are about to change#12868

Open
wombatu-kun wants to merge 2 commits intoapache:masterfrom
wombatu-kun:HUDI-8418_merge_mode_should_not_change
Open

[HUDI-8418] Throw an error if the table configs of record merge are about to change#12868
wombatu-kun wants to merge 2 commits intoapache:masterfrom
wombatu-kun:HUDI-8418_merge_mode_should_not_change

Conversation

@wombatu-kun
Copy link
Contributor

Change Logs

By design, the merge mode configs should not change in the table configs after table creation. So we add this strict check and throw an error.

Impact

Merge mode and payload configs now unable to change after table creation.

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

none

Documentation Update

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:S PR with lines of changes in (10, 100] label Feb 21, 2025
@wombatu-kun wombatu-kun force-pushed the HUDI-8418_merge_mode_should_not_change branch from 4e4f3fd to cef88ed Compare February 21, 2025 15:39
@wombatu-kun
Copy link
Contributor Author

@hudi-bot run azure

@wombatu-kun wombatu-kun marked this pull request as ready for review February 22, 2025 01:44
@danny0405
Copy link
Contributor

cc @yihua to take care.

@github-actions github-actions bot added size:M PR with lines of changes in (100, 300] and removed size:S PR with lines of changes in (10, 100] labels Mar 3, 2025
@wombatu-kun
Copy link
Contributor Author

@hudi-bot run azure

@wombatu-kun wombatu-kun force-pushed the HUDI-8418_merge_mode_should_not_change branch from 0a22377 to 9d2569e Compare March 5, 2025 01:46
@wombatu-kun wombatu-kun force-pushed the HUDI-8418_merge_mode_should_not_change branch from 9d2569e to 6603d51 Compare March 5, 2025 23:40
@wombatu-kun
Copy link
Contributor Author

@hudi-bot run azure

@hudi-bot
Copy link
Collaborator

hudi-bot commented Mar 6, 2025

CI report:

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

@wombatu-kun
Copy link
Contributor Author

@hudi-bot run azure


public HoodieTableConfig(HoodieStorage storage, StoragePath metaPath, RecordMergeMode recordMergeMode, String payloadClassName,
String recordMergeStrategyId) {
this(storage, metaPath, recordMergeMode, payloadClassName, recordMergeStrategyId, true);
Copy link
Contributor

Choose a reason for hiding this comment

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

From usability standpoint, could we add a config to allow payload class or merge mode/strategy update when enabled, and keep this config disabled by default, i.e., not allowing record merge mode/strategy to change unless user enables it in rare cases?


//now using payload
assertEquals(DummyAvroPayload.class.getName(), props.get(HoodieTableConfig.PAYLOAD_CLASS_NAME.key()));
assertThrows(HoodieValidationException.class, () -> new HoodieDeltaStreamer(newCfg, jsc, fs, hiveServer.getHiveConf()));
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 similar functional tests using Spark datasource and SQL writes to ensure that merge configs cannot be changed if enabled?

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