diff options
author | Ivan Sukhov <evanevannnn@ydb.tech> | 2024-08-08 16:18:08 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-08 13:18:08 +0000 |
commit | 0333af70a8292f8f1cba2d6b41770665dbf96857 (patch) | |
tree | 23a227859072fc5dd3011f9650cea9c5fd01636e | |
parent | 7bc66166cceacef1433024d3125d45597b267d1c (diff) | |
download | ydb-0333af70a8292f8f1cba2d6b41770665dbf96857.tar.gz |
Futher fix for YQ-3428 (#7561)
-rw-r--r-- | ydb/core/external_sources/object_storage.cpp | 3 | ||||
-rw-r--r-- | ydb/tests/fq/s3/test_s3_0.py | 6 |
2 files changed, 5 insertions, 4 deletions
diff --git a/ydb/core/external_sources/object_storage.cpp b/ydb/core/external_sources/object_storage.cpp index 287e2ea643..b1947d828f 100644 --- a/ydb/core/external_sources/object_storage.cpp +++ b/ydb/core/external_sources/object_storage.cpp @@ -13,6 +13,7 @@ #include <ydb/library/yql/providers/common/structured_token/yql_token_builder.h> #include <ydb/library/yql/providers/s3/credentials/credentials.h> #include <ydb/library/yql/providers/s3/object_listers/yql_s3_list.h> +#include <ydb/library/yql/providers/s3/object_listers/yql_s3_path.h> #include <ydb/library/yql/providers/s3/path_generator/yql_s3_path_generator.h> #include <ydb/library/yql/providers/s3/proto/credentials.pb.h> #include <ydb/public/api/protos/ydb_status_codes.pb.h> @@ -307,7 +308,7 @@ struct TObjectStorageExternalSource : public IExternalSource { structuredTokenBuilder.SetNoAuth(); } - auto effectiveFilePattern = meta->TableLocation; + auto effectiveFilePattern = NYql::NS3::NormalizePath(meta->TableLocation); if (meta->TableLocation.EndsWith('/')) { effectiveFilePattern += '*'; } diff --git a/ydb/tests/fq/s3/test_s3_0.py b/ydb/tests/fq/s3/test_s3_0.py index 923a16f5fa..1c3ce29e64 100644 --- a/ydb/tests/fq/s3/test_s3_0.py +++ b/ydb/tests/fq/s3/test_s3_0.py @@ -273,15 +273,15 @@ Apple,2,22, read_data_2 = '''a,b,c 1,2,3''' - s3_client.put_object(Body=read_data_1, Bucket='fbucket', Key='/1.csv', ContentType='text/plain') - s3_client.put_object(Body=read_data_2, Bucket='fbucket', Key='/2.csv', ContentType='text/plain') + s3_client.put_object(Body=read_data_1, Bucket='fbucket', Key='test/1.csv', ContentType='text/plain') + s3_client.put_object(Body=read_data_2, Bucket='fbucket', Key='test/2.csv', ContentType='text/plain') kikimr.control_plane.wait_bootstrap(1) storage_connection_name = unique_prefix + "multiple_files_bucket" client.create_storage_connection(storage_connection_name, "fbucket") sql = f''' SELECT * - FROM `{storage_connection_name}`.`/` + FROM `{storage_connection_name}`.`/test/` WITH (format=csv_with_names, with_infer='true'); ''' |