Skip to content

[HUDI-14922] Fix Windows path separator in DFSPropertiesConfiguration.getConfPathFromEnv#18454

Merged
danny0405 merged 1 commit intoapache:masterfrom
mailtoboggavarapu-coder:fix/windows-path-separator-dfs-config-14922
Apr 17, 2026
Merged

[HUDI-14922] Fix Windows path separator in DFSPropertiesConfiguration.getConfPathFromEnv#18454
danny0405 merged 1 commit intoapache:masterfrom
mailtoboggavarapu-coder:fix/windows-path-separator-dfs-config-14922

Conversation

@mailtoboggavarapu-coder
Copy link
Copy Markdown
Contributor

@mailtoboggavarapu-coder mailtoboggavarapu-coder commented Apr 2, 2026

Describe the issue this Pull Request addresses

DFSPropertiesConfiguration.getConfPathFromEnv() uses File.separator when constructing storage paths. On Windows, File.separator is a backslash (\\), which is invalid for HDFS and cloud storage paths that always require a forward slash. This causes path construction to break when running Hudi on Windows.

Fixes #14922

Summary and Changelog

Fixed cross-platform path handling in DFSPropertiesConfiguration by replacing File.separator with StoragePath.SEPARATOR, which always returns the correct forward-slash separator for storage paths.

  • DFSPropertiesConfiguration.java: Replaced File.separator with StoragePath.SEPARATOR in getConfPathFromEnv() to ensure valid HDFS/cloud storage paths on Windows.

Impact

No public API or user-facing feature change. Fixes path construction for users running Hudi on Windows.

Risk Level

low — Single-line constant substitution; no logic change. StoragePath.SEPARATOR is the established Hudi constant for storage path separators.

Documentation Update

none

Contributor's checklist

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

@github-actions github-actions bot added the size:XS PR with lines of changes in <= 10 label Apr 2, 2026
Copy link
Copy Markdown
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.

🤖 This review was generated by an AI agent and may contain mistakes. Please verify any suggestions before applying.

LGTM — clean, targeted fix that correctly swaps the OS-dependent File.separator for the storage-layer constant StoragePath.SEPARATOR, ensuring HDFS/cloud paths always use / even when the agent runs on Windows. CI passes and the change is minimal with no behavioral impact on non-Windows platforms.

confDir = "file://" + confDir;
}
return Option.of(new StoragePath(confDir + File.separator + DEFAULT_PROPERTIES_FILE));
return Option.of(new StoragePath(confDir + StoragePath.SEPARATOR + DEFAULT_PROPERTIES_FILE));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤖 This fixes the join separator correctly. One thing I'm wondering about: on Windows, HUDI_CONF_DIR would typically be set to something like C:\hudi\conf, so after the file:// prefix is added you'd end up with file://C:\hudi\conf/hudi-defaults.conf — mixed separators. Is there a follow-up needed to normalize the backslashes in confDir itself before constructing the StoragePath? Or does StoragePath's URI parsing handle that gracefully?

@mailtoboggavarapu-coder
Copy link
Copy Markdown
Contributor Author

Pinging for committer approval. This PR (HUDI-14922) fixes the Windows path separator issue in DFSPropertiesConfiguration.getConfPathFromEnv so that config paths work correctly on both Windows and Unix. @yihua has already reviewed and LGTM'd this. Would appreciate a review and merge from a committer with write access to apache/hudi (@vinothchandrasekar / @alexeykudinkin / @danny0405 / @nsivabalan).

@mailtoboggavarapu-coder
Copy link
Copy Markdown
Contributor Author

CI Build Failures — Master Branch Issue (not this PR)

The Java CI build failures on this PR are not caused by our code changes. Investigation shows this is a master branch build issue introduced by commit d3e0201 ("fix(common): FutureUtils:allOf should always throw root cause exception", merged 2026-04-15T22:30Z).

Evidence:

  • The master branch CI run for d3e0201 (run 24481746190) shows the same "Build Project" step failures in test-common-and-other-modules and test-spark-java-tests-part2 jobs
  • Our code changes touch completely unrelated files (DFSPropertiesConfiguration.java / HiveIncrementalPuller.java / FileSystemBasedLockProvider.java / SqlFileBasedSource.java) — none of which interact with FutureUtils
  • The last successful PR CI run before d3e0201 (nsivabalan's run at 21:53 UTC same day) passed all 53/53 jobs with identical matrix configuration
  • Build failures occur in ~83–111 seconds (a full Maven build normally takes 340s+), consistent with an early Maven resolution/plugin failure rather than a compilation error in our code

The CI situation is being tracked. Once the master build stabilises, a re-run of CI on this PR should pass.

cc @vinothchandrasekar @alexeykudinkin @danny0405 @nsivabalan — would appreciate a re-run once the master build issue is resolved.

@mailtoboggavarapu-coder
Copy link
Copy Markdown
Contributor Author

@danny0405 Thank you for merging #18457 and #18467!

This PR (#18454) is the remaining Windows path-separator fix — [HUDI-14922] — a one-line change replacing File.separator with StoragePath.SEPARATOR in DFSPropertiesConfiguration.getConfPathFromEnv() to fix cross-platform compatibility. Branch has been synced with the latest master and fresh CI has been triggered (run 24512491916). Would appreciate a review when you get a chance!

@mailtoboggavarapu-coder
Copy link
Copy Markdown
Contributor Author

CI Re-triggered After Master Fix

Master has advanced past the broken d3e020132a commit (the FutureUtils:allOf change that broke Spark CI). Additionally, PRs #18457 and #18467 from this series have already been merged into master.

This branch has been synced with the updated master and an empty commit was pushed to re-trigger CI. CI results on this run should be clean.

@mailtoboggavarapu-coder mailtoboggavarapu-coder force-pushed the fix/windows-path-separator-dfs-config-14922 branch 2 times, most recently from dcbebca to 9fe651f Compare April 16, 2026 14:41
…iesConfiguration

Replaces File.separator with "/" (HDFS paths always use forward slash)
and removes the now-unused import java.io.File.

Fixes apache#14922
@mailtoboggavarapu-coder mailtoboggavarapu-coder force-pushed the fix/windows-path-separator-dfs-config-14922 branch from 9fe651f to 1c6a548 Compare April 16, 2026 15:33
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.86%. Comparing base (5b68607) to head (1c6a548).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master   #18454   +/-   ##
=========================================
  Coverage     68.85%   68.86%           
- Complexity    28241    28245    +4     
=========================================
  Files          2460     2460           
  Lines        135348   135348           
  Branches      16410    16410           
=========================================
+ Hits          93200    93208    +8     
+ Misses        34770    34764    -6     
+ Partials       7378     7376    -2     
Flag Coverage Δ
common-and-other-modules 44.57% <0.00%> (-0.01%) ⬇️
hadoop-mr-java-client 44.85% <0.00%> (ø)
spark-client-hadoop-common 48.51% <0.00%> (+<0.01%) ⬆️
spark-java-tests 48.96% <0.00%> (-0.02%) ⬇️
spark-scala-tests 45.50% <100.00%> (+<0.01%) ⬆️
utilities 38.22% <0.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...hudi/common/config/DFSPropertiesConfiguration.java 74.77% <100.00%> (ø)

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mailtoboggavarapu-coder
Copy link
Copy Markdown
Contributor Author

Hi @danny0405, all 55 CI checks are now passing ✅ for this PR.

This fix replaces File.separator with "/" (a forward-slash literal) in DFSPropertiesConfiguration.getConfPathFromEnv() to ensure valid storage paths on Windows, and removes the now-unused import java.io.File;.

Would you be able to review and merge when you get a chance? Thanks!

@hudi-bot
Copy link
Copy Markdown
Collaborator

CI report:

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

Copy link
Copy Markdown
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.

🤖 This review was generated by an AI agent and may contain mistakes. Please verify any suggestions before applying.

LGTM — clean single-line fix that correctly replaces File.separator with a literal forward slash for storage path construction, preventing breakage on Windows.

Copy link
Copy Markdown
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.

🤖 This review was generated by an AI agent and may contain mistakes. Please verify any suggestions before applying.

LGTM — straightforward fix replacing File.separator with "/" in storage path construction to avoid broken paths on Windows. Clean, low-risk change.

Copy link
Copy Markdown
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.

🤖 This review was generated by an AI agent and may contain mistakes. Please verify any suggestions before applying.

LGTM — straightforward fix replacing File.separator with a literal "/" to ensure valid HDFS/cloud storage paths on Windows.

@danny0405 danny0405 merged commit c1af4f5 into apache:master Apr 17, 2026
56 checks passed
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.

HoodieTableMetaClient.TEMPFOLDER_NAME causes IllegalArgumentException in windows environment

5 participants