From 70da7d1bb71fa46dd12710686b78d27c9ae58344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E7=A5=A5=E5=A8=81?= Date: Fri, 20 Sep 2024 06:05:37 +0000 Subject: [PATCH] Merge 'cherry-pick-60004253-2' into 'cnch-dev' fix(clickhousech@m-5285222427):[TO cnch-dev] Fix S3 foreign table parse region from URI See merge request: !25246 --- src/Storages/RemoteFile/StorageCloudS3.cpp | 2 +- src/Storages/RemoteFile/StorageCnchS3.cpp | 2 +- src/Storages/RemoteFile/StorageCnchS3.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Storages/RemoteFile/StorageCloudS3.cpp b/src/Storages/RemoteFile/StorageCloudS3.cpp index 0ff85862b3..1848720b16 100644 --- a/src/Storages/RemoteFile/StorageCloudS3.cpp +++ b/src/Storages/RemoteFile/StorageCloudS3.cpp @@ -139,7 +139,7 @@ void registerStorageCloudS3(StorageFactory & factory) arguments.format_name, arguments.compression_method)); - S3::URI s3_uri(arguments.url); + S3::URI s3_uri(arguments.url, true); Strings files{s3_uri.key}; S3ClientPtr client = initializeS3Client(args.getLocalContext(), arguments); std::shared_ptr s3_util = std::make_shared(client, s3_uri.bucket); diff --git a/src/Storages/RemoteFile/StorageCnchS3.cpp b/src/Storages/RemoteFile/StorageCnchS3.cpp index 79785979d7..89316c2313 100644 --- a/src/Storages/RemoteFile/StorageCnchS3.cpp +++ b/src/Storages/RemoteFile/StorageCnchS3.cpp @@ -45,7 +45,7 @@ namespace DB S3ClientPtr initializeS3Client(const ContextPtr & ctx, const CnchFileArguments & arguments) { - S3::URI uri(arguments.url); + S3::URI uri(arguments.url, true); if (uri.bucket.find_first_of("*?{") != DB::String::npos) throw Exception("Expression can not have wildcards inside bucket name", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); diff --git a/src/Storages/RemoteFile/StorageCnchS3.h b/src/Storages/RemoteFile/StorageCnchS3.h index f829c998a7..9ba2a60017 100644 --- a/src/Storages/RemoteFile/StorageCnchS3.h +++ b/src/Storages/RemoteFile/StorageCnchS3.h @@ -56,7 +56,7 @@ public: const CnchFileArguments & arguments_, const CnchFileSettings & settings_) : IStorageCnchFile(context_, table_id_, required_columns_, constraints_, setting_changes_, arguments_, settings_) - , s3_uri(arguments_.url) + , s3_uri(arguments_.url, true) { if (file_list.size() == 1) file_list[0] = s3_uri.key;