Skip to content

Commit

Permalink
fix s3 creating (#6273)
Browse files Browse the repository at this point in the history
  • Loading branch information
iddqdex authored Jul 4, 2024
1 parent 1064ddc commit 12caba2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
10 changes: 6 additions & 4 deletions ydb/library/workload/benchmark_base/workload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,21 @@ std::string TWorkloadGeneratorBase::GetDDLQueries() const {
notNull = "NOT NULL";
partitionBy = "PARTITION BY HASH";
break;
case TWorkloadBaseParams::EStoreType::ExternalS3:
storageType = fmt::format(R"(DATA_SOURCE = "{}_tpc_s3_external_source", FORMAT = "parquet", LOCATION = )", Params.GetPath());
case TWorkloadBaseParams::EStoreType::ExternalS3: {
TString dataSourceName = Params.GetFullTableName(nullptr) + "_s3_external_source";
storageType = fmt::format(R"(DATA_SOURCE = "{}", FORMAT = "parquet", LOCATION = )", dataSourceName);
notNull = "NOT NULL";
createExternalDataSource = fmt::format(R"(
CREATE EXTERNAL DATA SOURCE `{}_tpc_s3_external_source` WITH (
CREATE EXTERNAL DATA SOURCE `{}` WITH (
SOURCE_TYPE="ObjectStorage",
LOCATION="{}",
AUTH_METHOD="NONE"
);
)", Params.GetFullTableName(nullptr), Params.GetS3Endpoint());
)", dataSourceName, Params.GetS3Endpoint());
external = "EXTERNAL";
partitioning = "--";
primaryKey = "--";
}
case TWorkloadBaseParams::EStoreType::Row:
break;
}
Expand Down
4 changes: 2 additions & 2 deletions ydb/library/workload/clickbench/click_bench_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ CREATE {external} TABLE `{path}`
)
{partition_by}(CounterID, EventDate, UserID, EventTime, WatchID)
WITH (
{store}"{s3_prefix}/hits",
AUTO_PARTITIONING_BY_SIZE = ENABLED,
-- AUTO_PARTITIONING_BY_SIZE = "ENABLED",
{store}"{s3_prefix}/hits"
{partitioning} = 128
);
16 changes: 8 additions & 8 deletions ydb/library/workload/tpch/tpch_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ CREATE {external} TABLE `{path}/customer` (
{primary_key} (c_custkey)
)
{partition_by}(c_custkey)
WITH ({store}"{s3_prefix}/customer/",
WITH ({store}"{s3_prefix}/customer/"
{partitioning} = 64
);

Expand All @@ -36,7 +36,7 @@ CREATE {external} TABLE `{path}/lineitem` (
{primary_key} (l_orderkey, l_linenumber)
)
{partition_by}(l_orderkey)
WITH ({store}"{s3_prefix}/lineitem/",
WITH ({store}"{s3_prefix}/lineitem/"
{partitioning} = 64
);

Expand All @@ -49,7 +49,7 @@ CREATE {external} TABLE `{path}/nation` (
)
{partition_by}(n_nationkey)

WITH ({store}"{s3_prefix}/nation/",
WITH ({store}"{s3_prefix}/nation/"
{partitioning} = 1
);

Expand All @@ -66,7 +66,7 @@ CREATE {external} TABLE `{path}/orders` (
{primary_key} (o_orderkey)
)
{partition_by}(o_orderkey)
WITH ({store}"{s3_prefix}/orders/",
WITH ({store}"{s3_prefix}/orders/"
{partitioning} = 64
);

Expand All @@ -83,7 +83,7 @@ CREATE {external} TABLE `{path}/part` (
{primary_key}(p_partkey)
)
{partition_by}(p_partkey)
WITH ({store}"{s3_prefix}/part/",
WITH ({store}"{s3_prefix}/part/"
{partitioning} = 64
);

Expand All @@ -96,7 +96,7 @@ CREATE {external} TABLE `{path}/partsupp` (
{primary_key}(ps_partkey, ps_suppkey)
)
{partition_by}(ps_partkey)
WITH ({store}"{s3_prefix}/partsupp/",
WITH ({store}"{s3_prefix}/partsupp/"
{partitioning} = 64
);

Expand All @@ -107,7 +107,7 @@ CREATE {external} TABLE `{path}/region` (
{primary_key}(r_regionkey)
)
{partition_by}(r_regionkey)
WITH ({store}"{s3_prefix}/region/",
WITH ({store}"{s3_prefix}/region/"
{partitioning} = 1
);

Expand All @@ -122,6 +122,6 @@ CREATE {external} TABLE `{path}/supplier` (
{primary_key}(s_suppkey)
)
{partition_by}(s_suppkey)
WITH ({store}"{s3_prefix}/supplier/",
WITH ({store}"{s3_prefix}/supplier/"
{partitioning} = 64
);

0 comments on commit 12caba2

Please sign in to comment.