xushiyan commented on code in PR #457:
URL: https://github.com/apache/hudi-rs/pull/457#discussion_r2418457240
##########
crates/core/src/storage/util.rs:
##########
@@ -43,6 +43,22 @@ pub fn get_scheme_authority(url: &Url) -> String {
format!("{}://{}", url.scheme(), url.authority())
}
+/// Converts backslashes to forward slashes for cross-platform compatibility.
+pub fn normalize_path_for_storage(path: &str) -> String {
+ path.replace('\\', "/")
+}
+
+/// Joins path segments with forward slashes.
+pub fn join_storage_path(segments: &[&str]) -> String {
+ let joined = segments
+ .iter()
+ .map(|s| s.trim_matches('/').trim_matches('\\'))
+ .filter(|s| !s.is_empty())
+ .collect::<Vec<_>>()
+ .join("/");
+ normalize_path_for_storage(&joined)
Review Comment:
@yunchipang i've cherrypicked the commit with CI test setup for windows here
so it can detect more issues wrt the change. let's fix the PR to have CI all
green. then i'll revert the CI commit before merging it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]