Skip to content

Conversation

@prashantwason
Copy link
Member

@prashantwason prashantwason commented Dec 3, 2025

Describe the issue this Pull Request addresses

This PR fixes an issue where properties passed as arguments to DeltaStreamer are not properly handled when the --props parameter is empty or not specified.

The OSS code has a default value for --props pointing to DEFAULT_DFS_SOURCE_PROPERTIES. However, when --props is intentionally set to an empty string (or left unspecified), the passed-in properties should still be used instead of being ignored.

Summary and Changelog

Summary: Fixed DeltaStreamer to correctly use properties passed as arguments when --props is empty.

Changelog:

  • Added an else clause in HoodieStreamer.java to handle the case when cfg.propsFilePath is null or empty
  • When no properties file path is provided, the streamer now correctly uses properties from cfg.configs via UtilHelpers.getConfig()
  • This ensures properties passed programmatically to DeltaStreamer are not ignored

Impact

This is a bug fix that affects users who:

  • Use DeltaStreamer programmatically and pass properties via the configs parameter
  • Do not specify a --props file path or set it to empty

The fix ensures that properties are correctly applied in all scenarios, improving the reliability of property configuration in DeltaStreamer.

Risk Level

Low

This is a small, targeted fix that adds a missing else clause to handle an edge case. The change:

  • Does not modify existing behavior when a properties file is provided
  • Only affects the case where no properties file path is specified
  • Uses the same UtilHelpers.getConfig() method that is already used in the first branch of the conditional

Documentation Update

None. This is a bug fix that restores expected behavior without introducing new features or configs.

Contributor's checklist

  • Read through contributor's guide
  • Enough context is provided in the sections above
  • Adequate tests were added if applicable

…eamer.

The code depends on the existence of DEFAULT_DFS_SOURCE_PROPERTIES file. Overridden properties are specified for HoodieStreamer using --props=<filepath>. The code uses the default value of --props=DEFAULT_DFS_SOURCE_PROPERTIES. Since not everyone would want to use and publish the default properties file, we can pass an empty --props value. This fix ensures that when --props is an empty string we simply use the properties supplied as the argument to the HUDIStreamer class.
@prashantwason prashantwason changed the title fix: Corrected the reading of passed in properties when using DeltaStreamer [MINOR] Corrected the reading of passed in properties when using DeltaStreamer Dec 3, 2025
@github-actions github-actions bot added the size:XS PR with lines of changes in <= 10 label Dec 3, 2025
@hudi-bot
Copy link
Collaborator

hudi-bot commented Dec 3, 2025

CI report:

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

Comment on lines +191 to +194
} else if (!StringUtils.isNullOrEmpty(cfg.propsFilePath)) {
hoodieConfig.setAll(readConfig(hadoopConf, new Path(cfg.propsFilePath), cfg.configs).getProps());
} else {
hoodieConfig.setAll(UtilHelpers.getConfig(cfg.configs).getProps());
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add test cases on these new branches.

@yihua
Copy link
Contributor

yihua commented Dec 3, 2025

@prashantwason Could you follow the new PR title format: https://hudi.apache.org/contribute/how-to-contribute#pr-title-format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS PR with lines of changes in <= 10

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants