From 36eae99e39cb7c366600f109718611020c6ed5bf Mon Sep 17 00:00:00 2001 From: Wenzheng Liu Date: Wed, 6 Dec 2023 15:49:53 +0800 Subject: [PATCH] [GLUTEN-1632][CH]Daily Update Clickhouse Version (20231206) (#3938) * [GLUTEN-1632][CH]Daily Update Clickhouse Version (20231206) * fix build due to https://github.com/ClickHouse/ClickHouse/pull/55559 --------- Co-authored-by: kyligence-git Co-authored-by: Chang Chen --- cpp-ch/clickhouse.version | 4 +- .../SubstraitSource/ReadBufferBuilder.cpp | 39 +++++++++++++------ 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/cpp-ch/clickhouse.version b/cpp-ch/clickhouse.version index cba2d6d3ae72..c796051ded7b 100644 --- a/cpp-ch/clickhouse.version +++ b/cpp-ch/clickhouse.version @@ -1,3 +1,3 @@ CH_ORG=Kyligence -CH_BRANCH=rebase_ch/20231201 -CH_COMMIT=5c8237dd030 +CH_BRANCH=rebase_ch/20231206 +CH_COMMIT=5a611598662 diff --git a/cpp-ch/local-engine/Storages/SubstraitSource/ReadBufferBuilder.cpp b/cpp-ch/local-engine/Storages/SubstraitSource/ReadBufferBuilder.cpp index 249714429a19..b9b293da10aa 100644 --- a/cpp-ch/local-engine/Storages/SubstraitSource/ReadBufferBuilder.cpp +++ b/cpp-ch/local-engine/Storages/SubstraitSource/ReadBufferBuilder.cpp @@ -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 ret = std::move(new_client); @@ -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 ret = std::move(new_client); cacheClient(bucket_name, is_per_bucket, ret);