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
This commit is contained in:
魏祥威 2024-09-20 06:05:37 +00:00 committed by Fred Wang
parent 131bf36a8c
commit 70da7d1bb7
3 changed files with 3 additions and 3 deletions

View File

@ -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::S3Util> s3_util = std::make_shared<S3::S3Util>(client, s3_uri.bucket);

View File

@ -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);

View File

@ -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;