Browse Source

use yaml for table description instead yql (#11811)

Олег 12 hours ago
parent
commit
b7cfb3622d

+ 84 - 43
ydb/library/workload/benchmark_base/workload.cpp

@@ -1,6 +1,8 @@
 #include "workload.h"
 #include <contrib/libs/fmt/include/fmt/format.h>
 #include <ydb/public/api/protos/ydb_formats.pb.h>
+#include <ydb/library/yaml_json/yaml_to_json.h>
+#include <contrib/libs/yaml-cpp/include/yaml-cpp/node/parse.h>
 #include <util/string/cast.h>
 #include <util/system/spinlock.h>
 
@@ -33,52 +35,91 @@ const TString TWorkloadGeneratorBase::CsvFormatString = [] () {
     return settings.SerializeAsString();
 } ();
 
+void TWorkloadGeneratorBase::GenerateDDLForTable(IOutputStream& result, const NJson::TJsonValue& table, bool single) const {
+    auto specialTypes = GetSpecialDataTypes();
+    specialTypes["string_type"] = Params.GetStringType();
+    specialTypes["date_type"] = Params.GetDateType();
+    specialTypes["timestamp_type"] = Params.GetTimestampType();
+
+    const auto& tableName = table["name"].GetString();
+    const auto path = Params.GetFullTableName(single ? nullptr : tableName.c_str());
+    result << Endl << "CREATE ";
+    if (Params.GetStoreType() == TWorkloadBaseParams::EStoreType::ExternalS3) {
+        result << "EXTERNAL ";
+    }
+    result << "TABLE `" << path << "` (" << Endl;
+    TVector<TStringBuilder> columns;
+    for (const auto& column: table["columns"].GetArray()) {
+        const auto& columnName = column["name"].GetString();
+        columns.emplace_back();
+        auto& so = columns.back();
+        so << "    " << columnName << " ";
+        const auto& type = column["type"].GetString();
+        if (const auto* st = MapFindPtr(specialTypes, type)) {
+            so << *st;
+        } else {
+            so << type;
+        }
+        if (column["not_null"].GetBooleanSafe(false) && Params.GetStoreType() != TWorkloadBaseParams::EStoreType::Row) {
+            so << " NOT NULL";
+        }
+    }
+    result << JoinSeq(",\n", columns);
+    TVector<TStringBuf> keysV;
+    for (const auto& k: table["primary_key"].GetArray()) {
+        keysV.emplace_back(k.GetString());
+    }
+    const TString keys = JoinSeq(", ", keysV);
+    if (Params.GetStoreType() == TWorkloadBaseParams::EStoreType::ExternalS3) {
+        result << Endl;
+    } else {
+        result << "," << Endl << "    PRIMARY KEY (" << keys << ")" << Endl;
+    }
+    result << ")" << Endl;
+
+    if (Params.GetStoreType() == TWorkloadBaseParams::EStoreType::Column) {
+        result << "PARTITION BY HASH (" << keys << ")" << Endl;
+    }
+
+    result << "WITH (" << Endl;
+    if (Params.GetStoreType() == TWorkloadBaseParams::EStoreType::ExternalS3) {
+        result << "    DATA_SOURCE = \""+ Params.GetFullTableName(nullptr) + "_s3_external_source\", FORMAT = \"parquet\", LOCATION = \"" << Params.GetS3Prefix()
+            << "/" << (single ? TFsPath(Params.GetPath()).GetName() : (tableName + "/")) << "\"" << Endl;
+    } else {
+        if (Params.GetStoreType() == TWorkloadBaseParams::EStoreType::Column) {
+            result << "    STORE = COLUMN," << Endl;
+        }
+        result << "    AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = " << table["partitioning"].GetUIntegerSafe(64) << Endl;
+    }
+    result << ");" << Endl;
+}
+
 std::string TWorkloadGeneratorBase::GetDDLQueries() const {
-    TString storageType = "-- ";
-    TString notNull = "";
-    TString createExternalDataSource;
-    TString external;
-    TString partitioning = "AUTO_PARTITIONING_MIN_PARTITIONS_COUNT";
-    TString primaryKey = ", PRIMARY KEY";
-    TString partitionBy = "-- ";
-    switch (Params.GetStoreType()) {
-    case TWorkloadBaseParams::EStoreType::Column:
-        storageType = "STORE = COLUMN, --";
-        notNull = "NOT NULL";
-        partitionBy = "PARTITION BY HASH";
-        break;
-    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 `{}` WITH (
-                SOURCE_TYPE="ObjectStorage",
-                LOCATION="{}",
-                AUTH_METHOD="NONE"
-            );
-        )", dataSourceName, Params.GetS3Endpoint());
-        external = "EXTERNAL";
-        partitioning = "--";
-        primaryKey = "--";
+    const auto json = GetTablesJson();
+
+    TStringBuilder result;
+    result << "--!syntax_v1" << Endl;
+    if (Params.GetStoreType() == TWorkloadBaseParams::EStoreType::ExternalS3) {
+        result << "CREATE EXTERNAL DATA SOURCE `" << Params.GetFullTableName(nullptr) << "_s3_external_source` WITH (" << Endl
+            << "    SOURCE_TYPE=\"ObjectStorage\"," << Endl
+            << "    LOCATION=\"" << Params.GetS3Endpoint() << "\"," << Endl
+            << "    AUTH_METHOD=\"NONE\"" << Endl
+            << ");" << Endl;
     }
-    case TWorkloadBaseParams::EStoreType::Row:
-        break;
+
+    for (const auto& table: json["tables"].GetArray()) {
+        GenerateDDLForTable(result.Out, table, false);
+    }
+    if (json.Has("table")) {
+        GenerateDDLForTable(result.Out, json["table"], true);
     }
-    auto createSql = DoGetDDLQueries();
-    SubstGlobal(createSql, "{createExternal}", createExternalDataSource);
-    SubstGlobal(createSql, "{external}", external);
-    SubstGlobal(createSql, "{notnull}", notNull);
-    SubstGlobal(createSql, "{partitioning}", partitioning);
-    SubstGlobal(createSql, "{path}", Params.GetFullTableName(nullptr));
-    SubstGlobal(createSql, "{primary_key}", primaryKey);
-    SubstGlobal(createSql, "{s3_prefix}", Params.GetS3Prefix());
-    SubstGlobal(createSql, "{store}", storageType);
-    SubstGlobal(createSql, "{partition_by}", partitionBy);
-    SubstGlobal(createSql, "{string_type}", Params.GetStringType());
-    SubstGlobal(createSql, "{date_type}", Params.GetDateType());
-    SubstGlobal(createSql, "{timestamp_type}", Params.GetTimestampType());
-    return createSql.c_str();
+    return result;
+}
+
+NJson::TJsonValue TWorkloadGeneratorBase::GetTablesJson() const {
+    const auto tablesYaml = GetTablesYaml();
+    const auto yaml = YAML::Load(tablesYaml.c_str());
+    return NKikimr::NYaml::Yaml2Json(yaml, true);
 }
 
 TVector<std::string> TWorkloadGeneratorBase::GetCleanPaths() const {

+ 6 - 1
ydb/library/workload/benchmark_base/workload.h

@@ -3,6 +3,7 @@
 #include "state.h"
 #include <ydb/library/workload/abstract/workload_query_generator.h>
 #include <ydb/library/accessor/accessor.h>
+#include <library/cpp/json/json_value.h>
 #include <util/generic/set.h>
 #include <util/generic/deque.h>
 #include <util/folder/path.h>
@@ -47,10 +48,14 @@ public:
     static const TString PsvFormatString;
 
 protected:
-    virtual TString DoGetDDLQueries() const = 0;
+    using TSpecialDataTypes = TMap<TString, TString>;
+    virtual TString GetTablesYaml() const = 0;
+    virtual TSpecialDataTypes GetSpecialDataTypes() const = 0;
+    NJson::TJsonValue GetTablesJson() const;
 
     THolder<TGeneratorStateProcessor> StateProcessor;
 private:
+    void GenerateDDLForTable(IOutputStream& result, const NJson::TJsonValue& table, bool single) const;
     const TWorkloadBaseParams& Params;
 };
 

+ 1 - 0
ydb/library/workload/benchmark_base/ya.make

@@ -10,6 +10,7 @@ SRCS(
 PEERDIR(
     ydb/library/accessor
     ydb/library/workload/abstract
+    ydb/library/yaml_json
     ydb/public/api/protos
 )
 

+ 0 - 118
ydb/library/workload/clickbench/click_bench_schema.sql

@@ -1,118 +0,0 @@
---!syntax_v1
-{createExternal}
-
-CREATE {external} TABLE `{path}`
-(
-    WatchID Int64 {notnull},
-    JavaEnable Int16 {notnull},
-    Title {string_type} {notnull},
-    GoodEvent Int16 {notnull},
-    EventTime {timestamp_type} {notnull},
-    EventDate {date_type} {notnull},
-    CounterID Int32 {notnull},
-    ClientIP Int32 {notnull},
-    RegionID Int32 {notnull},
-    UserID Int64 {notnull},
-    CounterClass Int16 {notnull},
-    OS Int16 {notnull},
-    UserAgent Int16 {notnull},
-    URL {string_type} {notnull},
-    Referer {string_type} {notnull},
-    IsRefresh Int16 {notnull},
-    RefererCategoryID Int16 {notnull},
-    RefererRegionID Int32 {notnull},
-    URLCategoryID Int16 {notnull},
-    URLRegionID Int32 {notnull},
-    ResolutionWidth Int16 {notnull},
-    ResolutionHeight Int16 {notnull},
-    ResolutionDepth Int16 {notnull},
-    FlashMajor Int16 {notnull},
-    FlashMinor Int16 {notnull},
-    FlashMinor2 {string_type} {notnull},
-    NetMajor Int16 {notnull},
-    NetMinor Int16 {notnull},
-    UserAgentMajor Int16 {notnull},
-    UserAgentMinor Bytes {notnull},
-    CookieEnable Int16 {notnull},
-    JavascriptEnable Int16 {notnull},
-    IsMobile Int16 {notnull},
-    MobilePhone Int16 {notnull},
-    MobilePhoneModel {string_type} {notnull},
-    Params {string_type} {notnull},
-    IPNetworkID Int32 {notnull},
-    TraficSourceID Int16 {notnull},
-    SearchEngineID Int16 {notnull},
-    SearchPhrase {string_type} {notnull},
-    AdvEngineID Int16 {notnull},
-    IsArtifical Int16 {notnull},
-    WindowClientWidth Int16 {notnull},
-    WindowClientHeight Int16 {notnull},
-    ClientTimeZone Int16 {notnull},
-    ClientEventTime {timestamp_type} {notnull},
-    SilverlightVersion1 Int16 {notnull},
-    SilverlightVersion2 Int16 {notnull},
-    SilverlightVersion3 Int32 {notnull},
-    SilverlightVersion4 Int16 {notnull},
-    PageCharset {string_type} {notnull},
-    CodeVersion Int32 {notnull},
-    IsLink Int16 {notnull},
-    IsDownload Int16 {notnull},
-    IsNotBounce Int16 {notnull},
-    FUniqID Int64 {notnull},
-    OriginalURL {string_type} {notnull},
-    HID Int32 {notnull},
-    IsOldCounter Int16 {notnull},
-    IsEvent Int16 {notnull},
-    IsParameter Int16 {notnull},
-    DontCountHits Int16 {notnull},
-    WithHash Int16 {notnull},
-    HitColor {string_type} {notnull},
-    LocalEventTime {timestamp_type} {notnull},
-    Age Int16 {notnull},
-    Sex Int16 {notnull},
-    Income Int16 {notnull},
-    Interests Int16 {notnull},
-    Robotness Int16 {notnull},
-    RemoteIP Int32 {notnull},
-    WindowName Int32 {notnull},
-    OpenerName Int32 {notnull},
-    HistoryLength Int16 {notnull},
-    BrowserLanguage {string_type} {notnull},
-    BrowserCountry {string_type} {notnull},
-    SocialNetwork {string_type} {notnull},
-    SocialAction {string_type} {notnull},
-    HTTPError Int16 {notnull},
-    SendTiming Int32 {notnull},
-    DNSTiming Int32 {notnull},
-    ConnectTiming Int32 {notnull},
-    ResponseStartTiming Int32 {notnull},
-    ResponseEndTiming Int32 {notnull},
-    FetchTiming Int32 {notnull},
-    SocialSourceNetworkID Int16 {notnull},
-    SocialSourcePage {string_type} {notnull},
-    ParamPrice Int64 {notnull},
-    ParamOrderID {string_type} {notnull},
-    ParamCurrency {string_type} {notnull},
-    ParamCurrencyID Int16 {notnull},
-    OpenstatServiceName {string_type} {notnull},
-    OpenstatCampaignID {string_type} {notnull},
-    OpenstatAdID {string_type} {notnull},
-    OpenstatSourceID {string_type} {notnull},
-    UTMSource {string_type} {notnull},
-    UTMMedium {string_type} {notnull},
-    UTMCampaign {string_type} {notnull},
-    UTMContent {string_type} {notnull},
-    UTMTerm {string_type} {notnull},
-    FromTag {string_type} {notnull},
-    HasGCLID Int16 {notnull},
-    RefererHash Int64 {notnull},
-    URLHash Int64 {notnull},
-    CLID Int32 {notnull}
-    {primary_key}(CounterID, EventDate, UserID, EventTime, WatchID)
-)
-{partition_by}(CounterID, EventDate, UserID, EventTime, WatchID)
-WITH (
---    AUTO_PARTITIONING_BY_SIZE = "ENABLED",
-    {store}"{s3_prefix}/hits"
-    {partitioning} = 128
-);

+ 324 - 0
ydb/library/workload/clickbench/click_bench_schema.yaml

@@ -0,0 +1,324 @@
+table:
+  columns:
+    - name: WatchID
+      type: Int64
+      not_null: true
+    - name: JavaEnable
+      type: Int16
+      not_null: true
+    - name: Title
+      type: string_type
+      not_null: true
+    - name: GoodEvent
+      type: Int16
+      not_null: true
+    - name: EventTime
+      type: timestamp_type
+      not_null: true
+    - name: EventDate
+      type: date_type
+      not_null: true
+    - name: CounterID
+      type: Int32
+      not_null: true
+    - name: ClientIP
+      type: Int32
+      not_null: true
+    - name: RegionID
+      type: Int32
+      not_null: true
+    - name: UserID
+      type: Int64
+      not_null: true
+    - name: CounterClass
+      type: Int16
+      not_null: true
+    - name: OS
+      type: Int16
+      not_null: true
+    - name: UserAgent
+      type: Int16
+      not_null: true
+    - name: URL
+      type: string_type
+      not_null: true
+    - name: Referer
+      type: string_type
+      not_null: true
+    - name: IsRefresh
+      type: Int16
+      not_null: true
+    - name: RefererCategoryID
+      type: Int16
+      not_null: true
+    - name: RefererRegionID
+      type: Int32
+      not_null: true
+    - name: URLCategoryID
+      type: Int16
+      not_null: true
+    - name: URLRegionID
+      type: Int32
+      not_null: true
+    - name: ResolutionWidth
+      type: Int16
+      not_null: true
+    - name: ResolutionHeight
+      type: Int16
+      not_null: true
+    - name: ResolutionDepth
+      type: Int16
+      not_null: true
+    - name: FlashMajor
+      type: Int16
+      not_null: true
+    - name: FlashMinor
+      type: Int16
+      not_null: true
+    - name: FlashMinor2
+      type: string_type
+      not_null: true
+    - name: NetMajor
+      type: Int16
+      not_null: true
+    - name: NetMinor
+      type: Int16
+      not_null: true
+    - name: UserAgentMajor
+      type: Int16
+      not_null: true
+    - name: UserAgentMinor
+      type: Bytes
+      not_null: true
+    - name: CookieEnable
+      type: Int16
+      not_null: true
+    - name: JavascriptEnable
+      type: Int16
+      not_null: true
+    - name: IsMobile
+      type: Int16
+      not_null: true
+    - name: MobilePhone
+      type: Int16
+      not_null: true
+    - name: MobilePhoneModel
+      type: string_type
+      not_null: true
+    - name: Params
+      type: string_type
+      not_null: true
+    - name: IPNetworkID
+      type: Int32
+      not_null: true
+    - name: TraficSourceID
+      type: Int16
+      not_null: true
+    - name: SearchEngineID
+      type: Int16
+      not_null: true
+    - name: SearchPhrase
+      type: string_type
+      not_null: true
+    - name: AdvEngineID
+      type: Int16
+      not_null: true
+    - name: IsArtifical
+      type: Int16
+      not_null: true
+    - name: WindowClientWidth
+      type: Int16
+      not_null: true
+    - name: WindowClientHeight
+      type: Int16
+      not_null: true
+    - name: ClientTimeZone
+      type: Int16
+      not_null: true
+    - name: ClientEventTime
+      type: timestamp_type
+      not_null: true
+    - name: SilverlightVersion1
+      type: Int16
+      not_null: true
+    - name: SilverlightVersion2
+      type: Int16
+      not_null: true
+    - name: SilverlightVersion3
+      type: Int32
+      not_null: true
+    - name: SilverlightVersion4
+      type: Int16
+      not_null: true
+    - name: PageCharset
+      type: string_type
+      not_null: true
+    - name: CodeVersion
+      type: Int32
+      not_null: true
+    - name: IsLink
+      type: Int16
+      not_null: true
+    - name: IsDownload
+      type: Int16
+      not_null: true
+    - name: IsNotBounce
+      type: Int16
+      not_null: true
+    - name: FUniqID
+      type: Int64
+      not_null: true
+    - name: OriginalURL
+      type: string_type
+      not_null: true
+    - name: HID
+      type: Int32
+      not_null: true
+    - name: IsOldCounter
+      type: Int16
+      not_null: true
+    - name: IsEvent
+      type: Int16
+      not_null: true
+    - name: IsParameter
+      type: Int16
+      not_null: true
+    - name: DontCountHits
+      type: Int16
+      not_null: true
+    - name: WithHash
+      type: Int16
+      not_null: true
+    - name: HitColor
+      type: string_type
+      not_null: true
+    - name: LocalEventTime
+      type: timestamp_type
+      not_null: true
+    - name: Age
+      type: Int16
+      not_null: true
+    - name: Sex
+      type: Int16
+      not_null: true
+    - name: Income
+      type: Int16
+      not_null: true
+    - name: Interests
+      type: Int16
+      not_null: true
+    - name: Robotness
+      type: Int16
+      not_null: true
+    - name: RemoteIP
+      type: Int32
+      not_null: true
+    - name: WindowName
+      type: Int32
+      not_null: true
+    - name: OpenerName
+      type: Int32
+      not_null: true
+    - name: HistoryLength
+      type: Int16
+      not_null: true
+    - name: BrowserLanguage
+      type: string_type
+      not_null: true
+    - name: BrowserCountry
+      type: string_type
+      not_null: true
+    - name: SocialNetwork
+      type: string_type
+      not_null: true
+    - name: SocialAction
+      type: string_type
+      not_null: true
+    - name: HTTPError
+      type: Int16
+      not_null: true
+    - name: SendTiming
+      type: Int32
+      not_null: true
+    - name: DNSTiming
+      type: Int32
+      not_null: true
+    - name: ConnectTiming
+      type: Int32
+      not_null: true
+    - name: ResponseStartTiming
+      type: Int32
+      not_null: true
+    - name: ResponseEndTiming
+      type: Int32
+      not_null: true
+    - name: FetchTiming
+      type: Int32
+      not_null: true
+    - name: SocialSourceNetworkID
+      type: Int16
+      not_null: true
+    - name: SocialSourcePage
+      type: string_type
+      not_null: true
+    - name: ParamPrice
+      type: Int64
+      not_null: true
+    - name: ParamOrderID
+      type: string_type
+      not_null: true
+    - name: ParamCurrency
+      type: string_type
+      not_null: true
+    - name: ParamCurrencyID
+      type: Int16
+      not_null: true
+    - name: OpenstatServiceName
+      type: string_type
+      not_null: true
+    - name: OpenstatCampaignID
+      type: string_type
+      not_null: true
+    - name: OpenstatAdID
+      type: string_type
+      not_null: true
+    - name: OpenstatSourceID
+      type: string_type
+      not_null: true
+    - name: UTMSource
+      type: string_type
+      not_null: true
+    - name: UTMMedium
+      type: string_type
+      not_null: true
+    - name: UTMCampaign
+      type: string_type
+      not_null: true
+    - name: UTMContent
+      type: string_type
+      not_null: true
+    - name: UTMTerm
+      type: string_type
+      not_null: true
+    - name: FromTag
+      type: string_type
+      not_null: true
+    - name: HasGCLID
+      type: Int16
+      not_null: true
+    - name: RefererHash
+      type: Int64
+      not_null: true
+    - name: URLHash
+      type: Int64
+      not_null: true
+    - name: CLID
+      type: Int32
+      not_null: true
+  primary_key:
+    - CounterID
+    - EventDate
+    - UserID
+    - EventTime
+    - WatchID
+  partitioning: 128

+ 6 - 2
ydb/library/workload/clickbench/clickbench.cpp

@@ -51,8 +51,12 @@ TClickbenchWorkloadGenerator::TClickbenchWorkloadGenerator(const TClickbenchWork
     , Params(params)
 {}
 
-TString TClickbenchWorkloadGenerator::DoGetDDLQueries() const {
-    return NResource::Find("click_bench_schema.sql");
+TString TClickbenchWorkloadGenerator::GetTablesYaml() const {
+    return NResource::Find("click_bench_schema.yaml");
+}
+
+TWorkloadGeneratorBase::TSpecialDataTypes TClickbenchWorkloadGenerator::GetSpecialDataTypes() const {
+    return {};
 }
 
 TQueryInfoList TClickbenchWorkloadGenerator::GetInitialData() {

+ 2 - 1
ydb/library/workload/clickbench/clickbench.h

@@ -30,7 +30,8 @@ public:
 
     class TBulkDataGenerator;
 protected:
-    TString DoGetDDLQueries() const override;
+    TString GetTablesYaml() const override;
+    TWorkloadGeneratorBase::TSpecialDataTypes GetSpecialDataTypes() const override;
     TQueryInfoList GetInitialData() override;
 
 private:

+ 8 - 19
ydb/library/workload/clickbench/data_generator.cpp

@@ -1,5 +1,7 @@
 #include "data_generator.h"
+#include <ydb/library/yaml_json/yaml_to_json.h>
 #include <library/cpp/streams/factory/open_by_signature/factory.h>
+#include <contrib/libs/yaml-cpp/include/yaml-cpp/node/parse.h>
 #include <util/stream/file.h>
 #include <thread>
 
@@ -94,24 +96,13 @@ public:
         , Delimiter(delimiter)
         , Foramt(foramt)
     {
-        const auto schema = NResource::Find("click_bench_schema.sql");
-        TStringInput si (schema);
+        const auto yaml = YAML::Load(NResource::Find("click_bench_schema.yaml").c_str());
+        const auto json = NKikimr::NYaml::Yaml2Json(yaml, true);
+        const auto& columns = json["table"]["columns"].GetArray();
         TVector<TString> header;
-        header.reserve(105);
-        TString line;
-        ui32 field = 0;
-        while (si.ReadLine(line)) {
-            if (line.find("{notnull}") != TString::npos) {
-                const auto parts = StringSplitter(line).Split(' ').SkipEmpty().ToList<TString>();
-                header.push_back(parts[0]);
-                if (parts[1].StartsWith("Date")) {
-                    DateFileds.insert(field);
-                }
-                if (parts[1].StartsWith("Timestamp")) {
-                    TsFileds.insert(field);
-                }
-                ++field;
-            }
+        header.reserve(columns.size());
+        for (const auto& c: columns) {
+            header.emplace_back(c["name"].GetString());
         }
         Header = JoinSeq(Delimiter, header);
     }
@@ -159,8 +150,6 @@ private:
     TString Path;
     THolder<IInputStream> Decompressor;
     TString Header;
-    TSet<ui32> DateFileds;
-    TSet<ui32> TsFileds;
     const TString& Delimiter;
     const TString& Foramt;
     TAdaptiveLock Lock;

+ 1 - 1
ydb/library/workload/clickbench/ya.make

@@ -10,7 +10,7 @@ RESOURCE(
     click_bench_queries.sql click_bench_queries.sql
     click_bench_queries_pg.sql click_bench_queries_pg.sql
     ${ARCADIA_ROOT}/ydb/tests/functional/clickbench/data/queries-deterministic.sql queries-deterministic.sql
-    click_bench_schema.sql click_bench_schema.sql
+    click_bench_schema.yaml click_bench_schema.yaml
     click_bench_canonical/q0.result click_bench_canonical/q0.result
     click_bench_canonical/q1.result click_bench_canonical/q1.result
     click_bench_canonical/q2.result click_bench_canonical/q2.result

+ 5 - 3
ydb/library/workload/tpc_base/tpc_base.cpp

@@ -87,10 +87,12 @@ TQueryInfoList TTpcBaseWorkloadGenerator::GetWorkload(int type) {
 void TTpcBaseWorkloadGenerator::PatchQuery(TString& query) const {
     SubstGlobal(query, "{% include 'header.sql.jinja' %}", GetHeader(query));
     SubstGlobal(query, "{path}", Params.GetFullTableName(nullptr) + "/");
-    for (const auto& table: GetTablesList()) {
+    const auto tableJson = GetTablesJson();
+    for (const auto& table: tableJson["tables"].GetArray()) {
+        const auto& tableName = table["name"].GetString();
         SubstGlobal(query, 
-            TStringBuilder() << "{{" << table << "}}", 
-            TStringBuilder() << Params.GetTablePathQuote(Params.GetSyntax()) << Params.GetPath() << "/" << table << Params.GetTablePathQuote(Params.GetSyntax())
+            TStringBuilder() << "{{" << tableName << "}}", 
+            TStringBuilder() << Params.GetTablePathQuote(Params.GetSyntax()) << Params.GetPath() << "/" << tableName << Params.GetTablePathQuote(Params.GetSyntax())
         );
     }
 }

Some files were not shown because too many files changed in this diff