Skip to content

Commit

Permalink
[fix](tvf) Support fs.defaultFS with postfix '/' apache#33202 (apache…
Browse files Browse the repository at this point in the history
  • Loading branch information
morningman authored and weixingyu12 committed Apr 8, 2024
1 parent c0baaa1 commit f96c316
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 f96c316

Please sign in to comment.