Skip to content

Commit

Permalink
[GLUTEN-1632][CH]Daily Update Clickhouse Version (20231206) (#3938)
Browse files Browse the repository at this point in the history
* [GLUTEN-1632][CH]Daily Update Clickhouse Version (20231206)

* fix build due to ClickHouse/ClickHouse#55559

---------

Co-authored-by: kyligence-git <[email protected]>
Co-authored-by: Chang Chen <[email protected]>
  • Loading branch information
3 people authored Dec 6, 2023
1 parent f389b11 commit 36eae99
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 14 deletions.
4 changes: 2 additions & 2 deletions cpp-ch/clickhouse.version
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
CH_ORG=Kyligence
CH_BRANCH=rebase_ch/20231201
CH_COMMIT=5c8237dd030
CH_BRANCH=rebase_ch/20231206
CH_COMMIT=5a611598662
39 changes: 27 additions & 12 deletions cpp-ch/local-engine/Storages/SubstraitSource/ReadBufferBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -583,21 +583,26 @@ class S3FileReadBufferBuilder : public ReadBufferBuilder
settings.tryGetString(BackendInitializerUtil::HADOOP_S3_SECRET_KEY, sk);
stripQuote(ak);
stripQuote(sk);
const DB::Settings & global_settings = context->getGlobalContext()->getSettingsRef();
const DB::Settings & local_settings = context->getSettingsRef();
if (use_assumed_role)
{
auto new_client = DB::S3::ClientFactory::instance().create(
client_configuration,
false,
ak,
sk,
"",
{},
{},
{.use_environment_credentials = true,
.use_insecure_imds_request = false,
.role_arn = getSetting(settings, bucket_name, BackendInitializerUtil::HADOOP_S3_ASSUMED_ROLE),
.session_name = getSetting(settings, bucket_name, BackendInitializerUtil::HADOOP_S3_ASSUMED_SESSION_NAME),
.external_id = getSetting(settings, bucket_name, BackendInitializerUtil::HADOOP_S3_ASSUMED_EXTERNAL_ID)});
local_settings.s3_disable_checksum,
false, // is_virtual_hosted_style
ak, // access_key_id
sk, // secret_access_key
"", // server_side_encryption_customer_key_base64
{}, // sse_kms_config
{}, // headers
DB::S3::CredentialsConfiguration{
.use_environment_credentials = true,
.use_insecure_imds_request = false,
.role_arn = getSetting(settings, bucket_name, BackendInitializerUtil::HADOOP_S3_ASSUMED_ROLE),
.session_name = getSetting(settings, bucket_name, BackendInitializerUtil::HADOOP_S3_ASSUMED_SESSION_NAME),
.external_id = getSetting(settings, bucket_name, BackendInitializerUtil::HADOOP_S3_ASSUMED_EXTERNAL_ID)
});

//TODO: support online change config for cached per_bucket_clients
std::shared_ptr<DB::S3::Client> ret = std::move(new_client);
Expand All @@ -607,7 +612,17 @@ class S3FileReadBufferBuilder : public ReadBufferBuilder
else
{
auto new_client = DB::S3::ClientFactory::instance().create(
client_configuration, false, ak, sk, "", {}, {}, {.use_environment_credentials = true, .use_insecure_imds_request = false});
client_configuration,
local_settings.s3_disable_checksum,
false, // is_virtual_hosted_style
ak, // access_key_id
sk, // secret_access_key
"", // server_side_encryption_customer_key_base64
{}, // sse_kms_config
{}, // headers
DB::S3::CredentialsConfiguration{
.use_environment_credentials = true,
.use_insecure_imds_request = false});

std::shared_ptr<DB::S3::Client> ret = std::move(new_client);
cacheClient(bucket_name, is_per_bucket, ret);
Expand Down

0 comments on commit 36eae99

Please sign in to comment.