Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions be/src/common/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1469,6 +1469,8 @@ DEFINE_mBool(enable_mow_verbose_log, "false");
// ATTN: this config is only for test
DEFINE_mBool(enable_prune_delete_sign_when_base_compaction, "true");

DEFINE_Bool(enable_root_path_of_hdfs_resource, "true");

// clang-format off
#ifdef BE_TEST
// test s3
Expand Down
5 changes: 5 additions & 0 deletions be/src/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -1542,6 +1542,11 @@ DECLARE_mBool(enable_mow_verbose_log);
// ATTN: this config is only for test
DECLARE_mBool(enable_prune_delete_sign_when_base_compaction);

// Because the root_path for the HDFS resource was previously passed an empty string (since v2.1),
// which was incorrect, this configuration has been added to ensure compatibility
// and guarantee that the root_path works as expected.
DECLARE_Bool(enable_root_path_of_hdfs_resource);

#ifdef BE_TEST
// test s3
DECLARE_String(test_s3_resource);
Expand Down
3 changes: 2 additions & 1 deletion be/src/io/fs/hdfs_file_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ Result<std::shared_ptr<HdfsFileSystem>> HdfsFileSystem::create(const THdfsParams

HdfsFileSystem::HdfsFileSystem(const THdfsParams& hdfs_params, std::string fs_name, std::string id,
RuntimeProfile* profile, std::string root_path)
: RemoteFileSystem(std::move(root_path), std::move(id), FileSystemType::HDFS),
: RemoteFileSystem(config::enable_root_path_of_hdfs_resource ? std::move(root_path) : "",
std::move(id), FileSystemType::HDFS),
_hdfs_params(hdfs_params),
_fs_name(std::move(fs_name)),
_profile(profile) {
Expand Down
Loading