Skip to content

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

Open
mailtoboggavarapu-coder wants to merge 1 commit intoapache:masterfrom
mailtoboggavarapu-coder:fix/windows-path-separator-dfs-config-14922
Open

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

Conversation

@mailtoboggavarapu-coder
Copy link
Copy Markdown
Contributor

Replace File.separator with StoragePath.SEPARATOR in DFSPropertiesConfiguration to ensure cross-platform compatibility. File.separator returns backslash () on Windows, which is invalid for HDFS/cloud storage paths that always require forward slash (/). StoragePath.SEPARATOR is the correct constant for storage paths in Hudi.

Fixes #14922

Describe the issue this Pull Request addresses

Summary and Changelog

Impact

Risk Level

Documentation Update

Contributor's checklist

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

….getConfPathFromEnv

Replace File.separator with StoragePath.SEPARATOR in DFSPropertiesConfiguration
to ensure cross-platform compatibility. File.separator returns backslash (\) on
Windows, which is invalid for HDFS/cloud storage paths that always require forward
slash (/). StoragePath.SEPARATOR is the correct constant for storage paths in Hudi.

Fixes apache#14922
@github-actions github-actions bot added the size:XS PR with lines of changes in <= 10 label Apr 2, 2026
@hudi-bot
Copy link
Copy Markdown
Collaborator

hudi-bot commented Apr 2, 2026

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, 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).

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

3 participants