Skip to content

Commit 12caba2

Browse files
authored
fix s3 creating (#6273)
1 parent 1064ddc commit 12caba2

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

ydb/library/workload/benchmark_base/workload.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,21 @@ std::string TWorkloadGeneratorBase::GetDDLQueries() const {
3838
notNull = "NOT NULL";
3939
partitionBy = "PARTITION BY HASH";
4040
break;
41-
case TWorkloadBaseParams::EStoreType::ExternalS3:
42-
storageType = fmt::format(R"(DATA_SOURCE = "{}_tpc_s3_external_source", FORMAT = "parquet", LOCATION = )", Params.GetPath());
41+
case TWorkloadBaseParams::EStoreType::ExternalS3: {
42+
TString dataSourceName = Params.GetFullTableName(nullptr) + "_s3_external_source";
43+
storageType = fmt::format(R"(DATA_SOURCE = "{}", FORMAT = "parquet", LOCATION = )", dataSourceName);
4344
notNull = "NOT NULL";
4445
createExternalDataSource = fmt::format(R"(
45-
CREATE EXTERNAL DATA SOURCE `{}_tpc_s3_external_source` WITH (
46+
CREATE EXTERNAL DATA SOURCE `{}` WITH (
4647
SOURCE_TYPE="ObjectStorage",
4748
LOCATION="{}",
4849
AUTH_METHOD="NONE"
4950
);
50-
)", Params.GetFullTableName(nullptr), Params.GetS3Endpoint());
51+
)", dataSourceName, Params.GetS3Endpoint());
5152
external = "EXTERNAL";
5253
partitioning = "--";
5354
primaryKey = "--";
55+
}
5456
case TWorkloadBaseParams::EStoreType::Row:
5557
break;
5658
}

ydb/library/workload/clickbench/click_bench_schema.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ CREATE {external} TABLE `{path}`
112112
)
113113
{partition_by}(CounterID, EventDate, UserID, EventTime, WatchID)
114114
WITH (
115-
{store}"{s3_prefix}/hits",
116-
AUTO_PARTITIONING_BY_SIZE = ENABLED,
115+
-- AUTO_PARTITIONING_BY_SIZE = "ENABLED",
116+
{store}"{s3_prefix}/hits"
117117
{partitioning} = 128
118118
);

ydb/library/workload/tpch/tpch_schema.sql

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ CREATE {external} TABLE `{path}/customer` (
1212
{primary_key} (c_custkey)
1313
)
1414
{partition_by}(c_custkey)
15-
WITH ({store}"{s3_prefix}/customer/",
15+
WITH ({store}"{s3_prefix}/customer/"
1616
{partitioning} = 64
1717
);
1818

@@ -36,7 +36,7 @@ CREATE {external} TABLE `{path}/lineitem` (
3636
{primary_key} (l_orderkey, l_linenumber)
3737
)
3838
{partition_by}(l_orderkey)
39-
WITH ({store}"{s3_prefix}/lineitem/",
39+
WITH ({store}"{s3_prefix}/lineitem/"
4040
{partitioning} = 64
4141
);
4242

@@ -49,7 +49,7 @@ CREATE {external} TABLE `{path}/nation` (
4949
)
5050
{partition_by}(n_nationkey)
5151

52-
WITH ({store}"{s3_prefix}/nation/",
52+
WITH ({store}"{s3_prefix}/nation/"
5353
{partitioning} = 1
5454
);
5555

@@ -66,7 +66,7 @@ CREATE {external} TABLE `{path}/orders` (
6666
{primary_key} (o_orderkey)
6767
)
6868
{partition_by}(o_orderkey)
69-
WITH ({store}"{s3_prefix}/orders/",
69+
WITH ({store}"{s3_prefix}/orders/"
7070
{partitioning} = 64
7171
);
7272

@@ -83,7 +83,7 @@ CREATE {external} TABLE `{path}/part` (
8383
{primary_key}(p_partkey)
8484
)
8585
{partition_by}(p_partkey)
86-
WITH ({store}"{s3_prefix}/part/",
86+
WITH ({store}"{s3_prefix}/part/"
8787
{partitioning} = 64
8888
);
8989

@@ -96,7 +96,7 @@ CREATE {external} TABLE `{path}/partsupp` (
9696
{primary_key}(ps_partkey, ps_suppkey)
9797
)
9898
{partition_by}(ps_partkey)
99-
WITH ({store}"{s3_prefix}/partsupp/",
99+
WITH ({store}"{s3_prefix}/partsupp/"
100100
{partitioning} = 64
101101
);
102102

@@ -107,7 +107,7 @@ CREATE {external} TABLE `{path}/region` (
107107
{primary_key}(r_regionkey)
108108
)
109109
{partition_by}(r_regionkey)
110-
WITH ({store}"{s3_prefix}/region/",
110+
WITH ({store}"{s3_prefix}/region/"
111111
{partitioning} = 1
112112
);
113113

@@ -122,6 +122,6 @@ CREATE {external} TABLE `{path}/supplier` (
122122
{primary_key}(s_suppkey)
123123
)
124124
{partition_by}(s_suppkey)
125-
WITH ({store}"{s3_prefix}/supplier/",
125+
WITH ({store}"{s3_prefix}/supplier/"
126126
{partitioning} = 64
127127
);

0 commit comments

Comments
 (0)