From e040dccbeca73afc77eff6c92ea85444fd5ab984 Mon Sep 17 00:00:00 2001 From: pengxiangyu Date: Tue, 27 Sep 2022 09:54:37 +0800 Subject: [PATCH] [fix](remote)fix bug for delete s3 dir and list s3 dir (#12918) * fix bug for delete s3 dir and list s3 dir --- be/src/io/fs/s3_file_system.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/be/src/io/fs/s3_file_system.cpp b/be/src/io/fs/s3_file_system.cpp index b3b7c74a025acb..00a4eed2928561 100644 --- a/be/src/io/fs/s3_file_system.cpp +++ b/be/src/io/fs/s3_file_system.cpp @@ -51,6 +51,9 @@ S3FileSystem::S3FileSystem(S3Conf s3_conf, ResourceId resource_id) fmt::format("{}/{}/{}", s3_conf.endpoint, s3_conf.bucket, s3_conf.prefix), std::move(resource_id), FileSystemType::S3), _s3_conf(std::move(s3_conf)) { + if (_s3_conf.prefix.size() > 0 && _s3_conf.prefix[0] == '/') { + _s3_conf.prefix = _s3_conf.prefix.substr(1); + } _executor = Aws::MakeShared( resource_id.c_str(), config::s3_transfer_executor_pool_size); }