Skip to content

Commit

Permalink
[fix](tvf) Support fs.defaultFS with postfix '/' #33202 (#33221)
Browse files Browse the repository at this point in the history
  • Loading branch information
morningman authored Apr 3, 2024
1 parent dc641c3 commit 0a6803e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions be/src/util/hdfs_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ Path convert_path(const Path& path, const std::string& namenode) {
Path real_path(path);
if (path.string().find(namenode) != std::string::npos) {
std::string real_path_str = path.string().substr(namenode.size());
if (!real_path_str.starts_with("/")) {
// The real path must starts with "/"
// Or the hadoop client will add a prefix like "/user/hadoop".
real_path_str = "/" + real_path_str;
}
real_path = real_path_str;
}
return real_path;
Expand Down

0 comments on commit 0a6803e

Please sign in to comment.