Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GLUTEN-8795][CH] Support to use oss with gluten #8796

Merged
merged 2 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions cpp-ch/local-engine/Common/CHUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ class BackendInitializerUtil
inline static const std::string HADOOP_S3_SECRET_KEY = "fs.s3a.secret.key";
inline static const std::string HADOOP_S3_ENDPOINT = "fs.s3a.endpoint";
inline static const std::string HADOOP_S3_ASSUMED_ROLE = "fs.s3a.assumed.role.arn";
inline static const std::string HADOOP_S3_PATH_STYLE_ACCESS = "fs.s3a.path.style.access";
inline static const std::string HADOOP_S3_ASSUMED_SESSION_NAME = "fs.s3a.assumed.role.session.name";
// not hadoop official
inline static const std::string HADOOP_S3_ASSUMED_EXTERNAL_ID = "fs.s3a.assumed.role.externalId";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include <Storages/ObjectStorage/HDFS/ReadBufferFromHDFS.h>
#include <Storages/SubstraitSource/ReadBufferBuilder.h>
#include <Storages/SubstraitSource/SubstraitFileSource.h>
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/compute/detail/lru_cache.hpp>
#include <sys/stat.h>
#include <Poco/Logger.h>
Expand Down Expand Up @@ -561,12 +562,17 @@ class S3FileReadBufferBuilder : public ReadBufferBuilder

std::string ak;
std::string sk;
std::string path_style_access;
bool addressing_type = false;
tryGetString(settings, BackendInitializerUtil::HADOOP_S3_ACCESS_KEY, ak);
tryGetString(settings, BackendInitializerUtil::HADOOP_S3_SECRET_KEY, sk);
tryGetString(settings, BackendInitializerUtil::HADOOP_S3_PATH_STYLE_ACCESS, path_style_access);
const DB::Settings & global_settings = context->getGlobalContext()->getSettingsRef();
const DB::Settings & local_settings = context->getSettingsRef();
boost::algorithm::to_lower(path_style_access);
addressing_type = (path_style_access == "false");
DB::S3::ClientSettings client_settings{
.use_virtual_addressing = false,
.use_virtual_addressing = addressing_type,
.disable_checksum = local_settings[DB::Setting::s3_disable_checksum],
.gcs_issue_compose_request = context->getConfigRef().getBool("s3.gcs_issue_compose_request", false),
};
Expand Down