Skip to content

Commit

Permalink
Only remove the schema for hdfs path.
Browse files Browse the repository at this point in the history
  • Loading branch information
JkSelf authored and glutenperfbot committed Dec 26, 2024
1 parent 8d1b909 commit a3c49b7
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ std::string HdfsFileSystem::name() const {
std::unique_ptr<ReadFile> HdfsFileSystem::openFileForRead(
std::string_view path,
const FileOptions& /*unused*/) {
// Only remove the schema for hdfs path.
if (path.find(kScheme) == 0) {
path.remove_prefix(kScheme.length());
if (auto index = path.find('/')) {
path.remove_prefix(index);
}
}

return std::make_unique<HdfsReadFile>(
impl_->hdfsShim(), impl_->hdfsClient(), path);
}
Expand Down

0 comments on commit a3c49b7

Please sign in to comment.