[HUDI-14922] Fix Windows path separator in DFSPropertiesConfiguration.getConfPathFromEnv#18454
Conversation
yihua
left a comment
There was a problem hiding this comment.
🤖 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)); |
There was a problem hiding this comment.
🤖 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?
|
Pinging for committer approval. This PR (HUDI-14922) fixes the Windows path separator issue in |
CI Build Failures — Master Branch Issue (not this PR)The Evidence:
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. |
|
@danny0405 Thank you for merging #18457 and #18467! This PR (#18454) is the remaining Windows path-separator fix — |
CI Re-triggered After Master FixMaster has advanced past the broken 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. |
dcbebca to
9fe651f
Compare
…iesConfiguration Replaces File.separator with "/" (HDFS paths always use forward slash) and removes the now-unused import java.io.File. Fixes apache#14922
9fe651f to
1c6a548
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Hi @danny0405, all 55 CI checks are now passing ✅ for this PR. This fix replaces Would you be able to review and merge when you get a chance? Thanks! |
yihua
left a comment
There was a problem hiding this comment.
🤖 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.
yihua
left a comment
There was a problem hiding this comment.
🤖 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.
yihua
left a comment
There was a problem hiding this comment.
🤖 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.
Describe the issue this Pull Request addresses
DFSPropertiesConfiguration.getConfPathFromEnv()usesFile.separatorwhen constructing storage paths. On Windows,File.separatoris 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
DFSPropertiesConfigurationby replacingFile.separatorwithStoragePath.SEPARATOR, which always returns the correct forward-slash separator for storage paths.DFSPropertiesConfiguration.java: ReplacedFile.separatorwithStoragePath.SEPARATORingetConfPathFromEnv()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.SEPARATORis the established Hudi constant for storage path separators.Documentation Update
none
Contributor's checklist