diff --git a/ydb/library/workload/benchmark_base/workload.cpp b/ydb/library/workload/benchmark_base/workload.cpp index 9fd3fe0baf6b..cd5cb0b9e8a1 100644 --- a/ydb/library/workload/benchmark_base/workload.cpp +++ b/ydb/library/workload/benchmark_base/workload.cpp @@ -1,6 +1,8 @@ #include "workload.h" #include #include +#include +#include #include #include @@ -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 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 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 TWorkloadGeneratorBase::GetCleanPaths() const { diff --git a/ydb/library/workload/benchmark_base/workload.h b/ydb/library/workload/benchmark_base/workload.h index 7e200f393e1d..9809dd686681 100644 --- a/ydb/library/workload/benchmark_base/workload.h +++ b/ydb/library/workload/benchmark_base/workload.h @@ -3,6 +3,7 @@ #include "state.h" #include #include +#include #include #include #include @@ -47,10 +48,14 @@ class TWorkloadGeneratorBase : public IWorkloadQueryGenerator { static const TString PsvFormatString; protected: - virtual TString DoGetDDLQueries() const = 0; + using TSpecialDataTypes = TMap; + virtual TString GetTablesYaml() const = 0; + virtual TSpecialDataTypes GetSpecialDataTypes() const = 0; + NJson::TJsonValue GetTablesJson() const; THolder StateProcessor; private: + void GenerateDDLForTable(IOutputStream& result, const NJson::TJsonValue& table, bool single) const; const TWorkloadBaseParams& Params; }; diff --git a/ydb/library/workload/benchmark_base/ya.make b/ydb/library/workload/benchmark_base/ya.make index 092d105714cd..ecb9f0dbd713 100644 --- a/ydb/library/workload/benchmark_base/ya.make +++ b/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 ) diff --git a/ydb/library/workload/clickbench/click_bench_schema.sql b/ydb/library/workload/clickbench/click_bench_schema.sql deleted file mode 100644 index 676d876a7685..000000000000 --- a/ydb/library/workload/clickbench/click_bench_schema.sql +++ /dev/null @@ -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 -); diff --git a/ydb/library/workload/clickbench/click_bench_schema.yaml b/ydb/library/workload/clickbench/click_bench_schema.yaml new file mode 100644 index 000000000000..3471a1a3306f --- /dev/null +++ b/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 diff --git a/ydb/library/workload/clickbench/clickbench.cpp b/ydb/library/workload/clickbench/clickbench.cpp index 228607dd1133..5b4d91ee501e 100644 --- a/ydb/library/workload/clickbench/clickbench.cpp +++ b/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() { diff --git a/ydb/library/workload/clickbench/clickbench.h b/ydb/library/workload/clickbench/clickbench.h index 47ba2c7889b7..f8872c291f83 100644 --- a/ydb/library/workload/clickbench/clickbench.h +++ b/ydb/library/workload/clickbench/clickbench.h @@ -30,7 +30,8 @@ class TClickbenchWorkloadGenerator final: public TWorkloadGeneratorBase { class TBulkDataGenerator; protected: - TString DoGetDDLQueries() const override; + TString GetTablesYaml() const override; + TWorkloadGeneratorBase::TSpecialDataTypes GetSpecialDataTypes() const override; TQueryInfoList GetInitialData() override; private: diff --git a/ydb/library/workload/clickbench/data_generator.cpp b/ydb/library/workload/clickbench/data_generator.cpp index 65a5d0366d7f..485c1a46d870 100644 --- a/ydb/library/workload/clickbench/data_generator.cpp +++ b/ydb/library/workload/clickbench/data_generator.cpp @@ -1,5 +1,7 @@ #include "data_generator.h" +#include #include +#include #include #include @@ -94,24 +96,13 @@ class TClickbenchWorkloadDataInitializerGenerator::TDataGenerartor::TCsvFileBase , 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 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(); - 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 @@ class TClickbenchWorkloadDataInitializerGenerator::TDataGenerartor::TCsvFileBase TString Path; THolder Decompressor; TString Header; - TSet DateFileds; - TSet TsFileds; const TString& Delimiter; const TString& Foramt; TAdaptiveLock Lock; diff --git a/ydb/library/workload/clickbench/ya.make b/ydb/library/workload/clickbench/ya.make index 9da5ed531214..d8597150f430 100644 --- a/ydb/library/workload/clickbench/ya.make +++ b/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 diff --git a/ydb/library/workload/tpc_base/tpc_base.cpp b/ydb/library/workload/tpc_base/tpc_base.cpp index 752fd112f687..c62ec613cae8 100644 --- a/ydb/library/workload/tpc_base/tpc_base.cpp +++ b/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()) ); } } diff --git a/ydb/library/workload/tpc_base/tpc_base.h b/ydb/library/workload/tpc_base/tpc_base.h index 43251e3e0aba..d4799cc8dce6 100644 --- a/ydb/library/workload/tpc_base/tpc_base.h +++ b/ydb/library/workload/tpc_base/tpc_base.h @@ -30,9 +30,6 @@ class TTpcBaseWorkloadGenerator: public TWorkloadGeneratorBase { TQueryInfoList GetInitialData() override final; TVector GetSupportedWorkloadTypes() const override final; -protected: - virtual TVector GetTablesList() const = 0; - private: const TTpcBaseWorkloadParams& Params; void PatchQuery(TString& query) const; diff --git a/ydb/library/workload/tpc_base/ya.make b/ydb/library/workload/tpc_base/ya.make index f5832be371cf..56710508e5dc 100644 --- a/ydb/library/workload/tpc_base/ya.make +++ b/ydb/library/workload/tpc_base/ya.make @@ -10,8 +10,8 @@ RESOURCE( ) PEERDIR( - ydb/library/accessor library/cpp/resource + ydb/library/accessor ydb/library/workload/benchmark_base ydb/public/lib/scheme_types ) diff --git a/ydb/library/workload/tpcds/tpcds.cpp b/ydb/library/workload/tpcds/tpcds.cpp index 98a132fb966c..f8ba8957d8f6 100644 --- a/ydb/library/workload/tpcds/tpcds.cpp +++ b/ydb/library/workload/tpcds/tpcds.cpp @@ -13,8 +13,11 @@ TTpcdsWorkloadGenerator::TTpcdsWorkloadGenerator(const TTpcdsWorkloadParams& par , Params(params) {} -TString TTpcdsWorkloadGenerator::DoGetDDLQueries() const { - auto schema = NResource::Find("tpcds_schema.sql"); +TString TTpcdsWorkloadGenerator::GetTablesYaml() const { + return NResource::Find("tpcds_schema.yaml"); +} + +TWorkloadGeneratorBase::TSpecialDataTypes TTpcdsWorkloadGenerator::GetSpecialDataTypes() const { TString decimalType_5_2, decimalType_7_2, decimalType_15_2; switch (Params.GetFloatMode()) { case TTpcBaseWorkloadParams::EFloatMode::FLOAT: @@ -30,38 +33,10 @@ TString TTpcdsWorkloadGenerator::DoGetDDLQueries() const { + "," + ::ToString(NKikimr::NScheme::DECIMAL_SCALE) + ")"; break; } - SubstGlobal(schema, "{decimal_5_2_type}", decimalType_5_2); - SubstGlobal(schema, "{decimal_7_2_type}", decimalType_7_2); - SubstGlobal(schema, "{decimal_15_2_type}", decimalType_15_2); - return schema; -} - -TVector TTpcdsWorkloadGenerator::GetTablesList() const { return { - "customer_address", - "customer_demographics", - "date_dim", - "warehouse", - "ship_mode", - "time_dim", - "reason", - "income_band", - "item", - "store", - "call_center", - "customer", - "web_site", - "store_returns", - "household_demographics", - "web_page", - "promotion", - "catalog_page", - "inventory", - "catalog_returns", - "web_returns", - "web_sales", - "catalog_sales", - "store_sales", + {"decimal_5_2_type", decimalType_5_2}, + {"decimal_7_2_type", decimalType_7_2}, + {"decimal_15_2_type", decimalType_15_2} }; } diff --git a/ydb/library/workload/tpcds/tpcds.h b/ydb/library/workload/tpcds/tpcds.h index bb0445486012..456d531b0caf 100644 --- a/ydb/library/workload/tpcds/tpcds.h +++ b/ydb/library/workload/tpcds/tpcds.h @@ -17,8 +17,8 @@ class TTpcdsWorkloadGenerator final: public TTpcBaseWorkloadGenerator { explicit TTpcdsWorkloadGenerator(const TTpcdsWorkloadParams& params); protected: - TString DoGetDDLQueries() const override; - TVector GetTablesList() const override; + TString GetTablesYaml() const override; + TWorkloadGeneratorBase::TSpecialDataTypes GetSpecialDataTypes() const override; private: const TTpcdsWorkloadParams& Params; diff --git a/ydb/library/workload/tpcds/tpcds_schema.sql b/ydb/library/workload/tpcds/tpcds_schema.sql deleted file mode 100644 index 4a184820cbd0..000000000000 --- a/ydb/library/workload/tpcds/tpcds_schema.sql +++ /dev/null @@ -1,666 +0,0 @@ -{createExternal} - -CREATE {external} TABLE `{path}/customer_address` -( - ca_address_sk Int64 {notnull}, - ca_address_id {string_type}, - ca_street_number {string_type}, - ca_street_name {string_type}, - ca_street_type {string_type}, - ca_suite_number {string_type}, - ca_city {string_type}, - ca_county {string_type}, - ca_state {string_type}, - ca_zip {string_type}, - ca_country {string_type}, - ca_gmt_offset {decimal_5_2_type} , - ca_location_type {string_type} - {primary_key} (ca_address_sk) -) -{partition_by}(ca_address_sk) -WITH ( -{store}"{s3_prefix}/customer_address/", -{partitioning} = 64 -); - -CREATE {external} TABLE `{path}/customer_demographics` -( - cd_demo_sk Int64 {notnull}, - cd_gender {string_type}, - cd_marital_status {string_type}, - cd_education_status {string_type}, - cd_purchase_estimate Int64 , - cd_credit_rating {string_type}, - cd_dep_count Int64 , - cd_dep_employed_count Int64 , - cd_dep_college_count Int64 - {primary_key} (cd_demo_sk) -) -{partition_by}(cd_demo_sk) -WITH ( -{store}"{s3_prefix}/customer_demographics/", -{partitioning} = 64 -); - -CREATE {external} TABLE `{path}/date_dim` -( - d_date_sk Int64 {notnull}, - d_date_id {string_type}, - d_date {string_type}, - d_month_seq Int64 , - d_week_seq Int64 , - d_quarter_seq Int64 , - d_year Int64 , - d_dow Int64 , - d_moy Int64 , - d_dom Int64 , - d_qoy Int64 , - d_fy_year Int64 , - d_fy_quarter_seq Int64 , - d_fy_week_seq Int64 , - d_day_name {string_type}, - d_quarter_name {string_type}, - d_holiday {string_type}, - d_weekend {string_type}, - d_following_holiday {string_type}, - d_first_dom Int64 , - d_last_dom Int64 , - d_same_day_ly Int64 , - d_same_day_lq Int64 , - d_current_day {string_type}, - d_current_week {string_type}, - d_current_month {string_type}, - d_current_quarter {string_type}, - d_current_year {string_type} - {primary_key} (d_date_sk) -) -{partition_by}(d_date_sk) -WITH ( -{store}"{s3_prefix}/date_dim/", -{partitioning} = 64 -); - -CREATE {external} TABLE `{path}/warehouse` -( - w_warehouse_sk Int64 {notnull}, - w_warehouse_id {string_type}, - w_warehouse_name {string_type}, - w_warehouse_sq_ft Int64 , - w_street_number {string_type}, - w_street_name {string_type}, - w_street_type {string_type}, - w_suite_number {string_type}, - w_city {string_type}, - w_county {string_type}, - w_state {string_type}, - w_zip {string_type}, - w_country {string_type}, - w_gmt_offset {decimal_5_2_type} - {primary_key} (w_warehouse_sk) -) -{partition_by}(w_warehouse_sk) -WITH ( -{store}"{s3_prefix}/warehouse/", -{partitioning} = 64 -); - -CREATE {external} TABLE `{path}/ship_mode` -( - sm_ship_mode_sk Int64 {notnull}, - sm_ship_mode_id {string_type}, - sm_type {string_type}, - sm_code {string_type}, - sm_carrier {string_type}, - sm_contract {string_type} - {primary_key} (sm_ship_mode_sk) -) -{partition_by}(sm_ship_mode_sk) -WITH ( -{store}"{s3_prefix}/ship_mode/", -{partitioning} = 64 -); - -CREATE {external} TABLE `{path}/time_dim` -( - t_time_sk Int64 {notnull}, - t_time_id {string_type}, - t_time Int64 , - t_hour Int64 , - t_minute Int64 , - t_second Int64 , - t_am_pm {string_type}, - t_shift {string_type}, - t_sub_shift {string_type}, - t_meal_time {string_type} - {primary_key} (t_time_sk) -) -{partition_by}(t_time_sk) -WITH ( -{store}"{s3_prefix}/time_dim/", -{partitioning} = 64 -); - -CREATE {external} TABLE `{path}/reason` -( - r_reason_sk Int64 {notnull}, - r_reason_id {string_type}, - r_reason_desc {string_type} - {primary_key} (r_reason_sk) -) -{partition_by}(r_reason_sk) -WITH ( -{store}"{s3_prefix}/reason/", -{partitioning} = 64 -); - -CREATE {external} TABLE `{path}/income_band` -( - ib_income_band_sk Int64 {notnull}, - ib_lower_bound Int64 , - ib_upper_bound Int64 - {primary_key} (ib_income_band_sk) -) -{partition_by}(ib_income_band_sk) -WITH ( -{store}"{s3_prefix}/income_band/", -{partitioning} = 64 -); - -CREATE {external} TABLE `{path}/item` -( - i_item_sk Int64 {notnull}, - i_item_id {string_type}, - i_rec_start_date {date_type} , - i_rec_end_date {date_type} , - i_item_desc {string_type}, - i_current_price {decimal_7_2_type}, - i_wholesale_cost {decimal_7_2_type}, - i_brand_id Int64 , - i_brand {string_type}, - i_class_id Int64 , - i_class {string_type}, - i_category_id Int64 , - i_category {string_type}, - i_manufact_id Int64 , - i_manufact {string_type}, - i_size {string_type}, - i_formulation {string_type}, - i_color {string_type}, - i_units {string_type}, - i_container {string_type}, - i_manager_id Int64 , - i_product_name {string_type} - {primary_key} (i_item_sk) -) -{partition_by}(i_item_sk) -WITH ( -{store}"{s3_prefix}/item/", -{partitioning} = 64 -); - -CREATE {external} TABLE `{path}/store` -( - s_store_sk Int64 {notnull}, - s_store_id {string_type}, - s_rec_start_date {date_type} , - s_rec_end_date {date_type} , - s_closed_date_sk Int64 , - s_store_name {string_type}, - s_number_employees Int64 , - s_floor_space Int64 , - s_hours {string_type}, - s_manager {string_type}, - s_market_id Int64 , - s_geography_class {string_type}, - s_market_desc {string_type}, - s_market_manager {string_type}, - s_division_id Int64 , - s_division_name {string_type}, - s_company_id Int64 , - s_company_name {string_type}, - s_street_number {string_type}, - s_street_name {string_type}, - s_street_type {string_type}, - s_suite_number {string_type}, - s_city {string_type}, - s_county {string_type}, - s_state {string_type}, - s_zip {string_type}, - s_country {string_type}, - s_gmt_offset {decimal_5_2_type}, - s_tax_precentage {decimal_5_2_type} - {primary_key} (s_store_sk) -) -{partition_by}(s_store_sk) -WITH ( -{store}"{s3_prefix}/store/", -{partitioning} = 64 -); - -CREATE {external} TABLE `{path}/call_center` -( - cc_call_center_sk Int64 {notnull}, - cc_call_center_id {string_type}, - cc_rec_start_date {date_type} , - cc_rec_end_date {date_type} , - cc_closed_date_sk Int64 , - cc_open_date_sk Int64 , - cc_name {string_type}, - cc_class {string_type}, - cc_employees Int64 , - cc_sq_ft Int64 , - cc_hours {string_type}, - cc_manager {string_type}, - cc_mkt_id Int64 , - cc_mkt_class {string_type}, - cc_mkt_desc {string_type}, - cc_market_manager {string_type}, - cc_division Int64 , - cc_division_name {string_type}, - cc_company Int64 , - cc_company_name {string_type}, - cc_street_number {string_type}, - cc_street_name {string_type}, - cc_street_type {string_type}, - cc_suite_number {string_type}, - cc_city {string_type}, - cc_county {string_type}, - cc_state {string_type}, - cc_zip {string_type}, - cc_country {string_type}, - cc_gmt_offset {decimal_5_2_type}, - cc_tax_percentage {decimal_5_2_type} - {primary_key} (cc_call_center_sk) -) -{partition_by}(cc_call_center_sk) -WITH ( -{store}"{s3_prefix}/call_center/", -{partitioning} = 64 -); - -CREATE {external} TABLE `{path}/customer` -( - c_customer_sk Int64 {notnull}, - c_customer_id {string_type}, - c_current_cdemo_sk Int64 , - c_current_hdemo_sk Int64 , - c_current_addr_sk Int64 , - c_first_shipto_date_sk Int64 , - c_first_sales_date_sk Int64 , - c_salutation {string_type}, - c_first_name {string_type}, - c_last_name {string_type}, - c_preferred_cust_flag {string_type}, - c_birth_day Int64 , - c_birth_month Int64 , - c_birth_year Int64 , - c_birth_country {string_type}, - c_login {string_type}, - c_email_address {string_type}, - c_last_review_date {string_type} - {primary_key} (c_customer_sk) -) -{partition_by}(c_customer_sk) -WITH ( -{store}"{s3_prefix}/customer/", -{partitioning} = 64 -); - -CREATE {external} TABLE `{path}/web_site` -( - web_site_sk Int64 {notnull}, - web_site_id {string_type}, - web_rec_start_date {date_type} , - web_rec_end_date {date_type} , - web_name {string_type}, - web_open_date_sk Int64 , - web_close_date_sk Int64 , - web_class {string_type}, - web_manager {string_type}, - web_mkt_id Int64 , - web_mkt_class {string_type}, - web_mkt_desc {string_type}, - web_market_manager {string_type}, - web_company_id Int64 , - web_company_name {string_type}, - web_street_number {string_type}, - web_street_name {string_type}, - web_street_type {string_type}, - web_suite_number {string_type}, - web_city {string_type}, - web_county {string_type}, - web_state {string_type}, - web_zip {string_type}, - web_country {string_type}, - web_gmt_offset {decimal_5_2_type}, - web_tax_percentage {decimal_5_2_type} - {primary_key} (web_site_sk) -) -{partition_by}(web_site_sk) -WITH ( -{store}"{s3_prefix}/web_site/", -{partitioning} = 64 -); - -CREATE {external} TABLE `{path}/store_returns` -( - sr_returned_date_sk Int64 , - sr_return_time_sk Int64 , - sr_item_sk Int64 {notnull}, - sr_customer_sk Int64 , - sr_cdemo_sk Int64 , - sr_hdemo_sk Int64 , - sr_addr_sk Int64 , - sr_store_sk Int64 , - sr_reason_sk Int64 , - sr_ticket_number Int64 {notnull}, - sr_return_quantity Int64 , - sr_return_amt {decimal_7_2_type}, - sr_return_tax {decimal_7_2_type}, - sr_return_amt_inc_tax {decimal_7_2_type}, - sr_fee {decimal_7_2_type}, - sr_return_ship_cost {decimal_15_2_type}, - sr_refunded_cash {decimal_7_2_type}, - sr_reversed_charge {decimal_7_2_type}, - sr_store_credit {decimal_7_2_type}, - sr_net_loss {decimal_7_2_type} - {primary_key} (sr_item_sk, sr_ticket_number) -) -{partition_by}(sr_item_sk, sr_ticket_number) -WITH ( -{store}"{s3_prefix}/store_returns/", -{partitioning} = 64 -); - -CREATE {external} TABLE `{path}/household_demographics` -( - hd_demo_sk Int64 {notnull}, - hd_income_band_sk Int64 , - hd_buy_potential {string_type}, - hd_dep_count Int64 , - hd_vehicle_count Int64 - {primary_key} (hd_demo_sk) -) -{partition_by}(hd_demo_sk) -WITH ( -{store}"{s3_prefix}/household_demographics/", -{partitioning} = 64 -); - -CREATE {external} TABLE `{path}/web_page` -( - wp_web_page_sk Int64 {notnull}, - wp_web_page_id {string_type}, - wp_rec_start_date {date_type} , - wp_rec_end_date {date_type} , - wp_creation_date_sk Int64 , - wp_access_date_sk Int64 , - wp_autogen_flag {string_type}, - wp_customer_sk Int64 , - wp_url {string_type}, - wp_type {string_type}, - wp_char_count Int64 , - wp_link_count Int64 , - wp_image_count Int64 , - wp_max_ad_count Int64 - {primary_key} (wp_web_page_sk) -) -{partition_by}(wp_web_page_sk) -WITH ( -{store}"{s3_prefix}/web_page/", -{partitioning} = 64 -); - -CREATE {external} TABLE `{path}/promotion` -( - p_promo_sk Int64 {notnull}, - p_promo_id {string_type}, - p_start_date_sk Int64 , - p_end_date_sk Int64 , - p_item_sk Int64 , - p_cost {decimal_7_2_type}, - p_response_target Int64 , - p_promo_name {string_type}, - p_channel_dmail {string_type}, - p_channel_email {string_type}, - p_channel_catalog {string_type}, - p_channel_tv {string_type}, - p_channel_radio {string_type}, - p_channel_press {string_type}, - p_channel_event {string_type}, - p_channel_demo {string_type}, - p_channel_details {string_type}, - p_purpose {string_type}, - p_discount_active {string_type} - {primary_key} (p_promo_sk) -) -{partition_by}(p_promo_sk) -WITH ( -{store}"{s3_prefix}/promotion/", -{partitioning} = 64 -); - -CREATE {external} TABLE `{path}/catalog_page` -( - cp_catalog_page_sk Int64 {notnull}, - cp_catalog_page_id {string_type}, - cp_start_date_sk Int64 , - cp_end_date_sk Int64 , - cp_department {string_type}, - cp_catalog_number Int64 , - cp_catalog_page_number Int64 , - cp_description {string_type}, - cp_type {string_type} - {primary_key} (cp_catalog_page_sk) -) -{partition_by}(cp_catalog_page_sk) -WITH ( -{store}"{s3_prefix}/catalog_page/", -{partitioning} = 64 -); - -CREATE {external} TABLE `{path}/inventory` -( - inv_date_sk Int64 {notnull}, - inv_item_sk Int64 {notnull}, - inv_warehouse_sk Int64 {notnull}, - inv_quantity_on_hand Int64 - {primary_key} (inv_date_sk, inv_item_sk, inv_warehouse_sk) -) -{partition_by}(inv_date_sk, inv_item_sk, inv_warehouse_sk) -WITH ( -{store}"{s3_prefix}/inventory/", -{partitioning} = 64 -); - -CREATE {external} TABLE `{path}/catalog_returns` -( - cr_returned_date_sk Int64 , - cr_returned_time_sk Int64 , - cr_item_sk Int64 {notnull}, - cr_refunded_customer_sk Int64 , - cr_refunded_cdemo_sk Int64 , - cr_refunded_hdemo_sk Int64 , - cr_refunded_addr_sk Int64 , - cr_returning_customer_sk Int64 , - cr_returning_cdemo_sk Int64 , - cr_returning_hdemo_sk Int64 , - cr_returning_addr_sk Int64 , - cr_call_center_sk Int64 , - cr_catalog_page_sk Int64 , - cr_ship_mode_sk Int64 , - cr_warehouse_sk Int64 , - cr_reason_sk Int64 , - cr_order_number Int64 {notnull}, - cr_return_quantity Int64 , - cr_return_amount {decimal_7_2_type}, - cr_return_tax {decimal_7_2_type}, - cr_return_amt_inc_tax {decimal_7_2_type}, - cr_fee {decimal_7_2_type}, - cr_return_ship_cost {decimal_7_2_type}, - cr_refunded_cash {decimal_7_2_type}, - cr_reversed_charge {decimal_7_2_type}, - cr_store_credit {decimal_7_2_type}, - cr_net_loss {decimal_7_2_type} - {primary_key} (cr_item_sk, cr_order_number) -) -{partition_by}(cr_item_sk, cr_order_number) -WITH ( -{store}"{s3_prefix}/catalog_returns/", -{partitioning} = 64 -); - -CREATE {external} TABLE `{path}/web_returns` -( - wr_returned_date_sk Int64 , - wr_returned_time_sk Int64 , - wr_item_sk Int64 {notnull}, - wr_refunded_customer_sk Int64 , - wr_refunded_cdemo_sk Int64 , - wr_refunded_hdemo_sk Int64 , - wr_refunded_addr_sk Int64 , - wr_returning_customer_sk Int64 , - wr_returning_cdemo_sk Int64 , - wr_returning_hdemo_sk Int64 , - wr_returning_addr_sk Int64 , - wr_web_page_sk Int64 , - wr_reason_sk Int64 , - wr_order_number Int64 {notnull}, - wr_return_quantity Int64 , - wr_return_amt {decimal_7_2_type}, - wr_return_tax {decimal_7_2_type}, - wr_return_amt_inc_tax {decimal_7_2_type}, - wr_fee {decimal_7_2_type}, - wr_return_ship_cost {decimal_7_2_type}, - wr_refunded_cash {decimal_7_2_type}, - wr_reversed_charge {decimal_7_2_type}, - wr_account_credit {decimal_7_2_type}, - wr_net_loss {decimal_7_2_type} - {primary_key} (wr_item_sk, wr_order_number) -) -{partition_by}(wr_item_sk, wr_order_number) -WITH ( -{store}"{s3_prefix}/web_returns/", -{partitioning} = 64 -); - -CREATE {external} TABLE `{path}/web_sales` -( - ws_sold_date_sk Int64 , - ws_sold_time_sk Int64 , - ws_ship_date_sk Int64 , - ws_item_sk Int64 {notnull}, - ws_bill_customer_sk Int64 , - ws_bill_cdemo_sk Int64 , - ws_bill_hdemo_sk Int64 , - ws_bill_addr_sk Int64 , - ws_ship_customer_sk Int64 , - ws_ship_cdemo_sk Int64 , - ws_ship_hdemo_sk Int64 , - ws_ship_addr_sk Int64 , - ws_web_page_sk Int64 , - ws_web_site_sk Int64 , - ws_ship_mode_sk Int64 , - ws_warehouse_sk Int64 , - ws_promo_sk Int64 , - ws_order_number Int64 {notnull}, - ws_quantity Int64 , - ws_wholesale_cost {decimal_7_2_type}, - ws_list_price {decimal_7_2_type}, - ws_sales_price {decimal_7_2_type}, - ws_ext_discount_amt {decimal_7_2_type}, - ws_ext_sales_price {decimal_7_2_type}, - ws_ext_wholesale_cost {decimal_7_2_type}, - ws_ext_list_price {decimal_7_2_type}, - ws_ext_tax {decimal_7_2_type}, - ws_coupon_amt {decimal_7_2_type}, - ws_ext_ship_cost {decimal_7_2_type}, - ws_net_paid {decimal_7_2_type}, - ws_net_paid_inc_tax {decimal_7_2_type}, - ws_net_paid_inc_ship {decimal_7_2_type}, - ws_net_paid_inc_ship_tax {decimal_7_2_type}, - ws_net_profit {decimal_7_2_type} - {primary_key} (ws_item_sk, ws_order_number) -) -{partition_by}(ws_item_sk, ws_order_number) -WITH ( -{store}"{s3_prefix}/web_sales/", -{partitioning} = 64 -); - -CREATE {external} TABLE `{path}/catalog_sales` -( - cs_sold_date_sk Int64 , - cs_sold_time_sk Int64 , - cs_ship_date_sk Int64 , - cs_bill_customer_sk Int64 , - cs_bill_cdemo_sk Int64 , - cs_bill_hdemo_sk Int64 , - cs_bill_addr_sk Int64 , - cs_ship_customer_sk Int64 , - cs_ship_cdemo_sk Int64 , - cs_ship_hdemo_sk Int64 , - cs_ship_addr_sk Int64 , - cs_call_center_sk Int64 , - cs_catalog_page_sk Int64 , - cs_ship_mode_sk Int64 , - cs_warehouse_sk Int64 , - cs_item_sk Int64 {notnull}, - cs_promo_sk Int64 , - cs_order_number Int64 {notnull}, - cs_quantity Int64 , - cs_wholesale_cost {decimal_7_2_type}, - cs_list_price {decimal_7_2_type}, - cs_sales_price {decimal_7_2_type}, - cs_ext_discount_amt {decimal_7_2_type}, - cs_ext_sales_price {decimal_7_2_type}, - cs_ext_wholesale_cost {decimal_7_2_type}, - cs_ext_list_price {decimal_7_2_type}, - cs_ext_tax {decimal_7_2_type}, - cs_coupon_amt {decimal_7_2_type}, - cs_ext_ship_cost {decimal_7_2_type}, - cs_net_paid {decimal_7_2_type}, - cs_net_paid_inc_tax {decimal_7_2_type}, - cs_net_paid_inc_ship {decimal_7_2_type}, - cs_net_paid_inc_ship_tax {decimal_7_2_type}, - cs_net_profit {decimal_7_2_type} - {primary_key} (cs_item_sk, cs_order_number) -) -{partition_by}(cs_item_sk, cs_order_number) -WITH ( -{store}"{s3_prefix}/catalog_sales/", -{partitioning} = 64 -); - -CREATE {external} TABLE `{path}/store_sales` -( - ss_sold_date_sk Int64 , - ss_sold_time_sk Int64 , - ss_item_sk Int64 {notnull}, - ss_customer_sk Int64 , - ss_cdemo_sk Int64 , - ss_hdemo_sk Int64 , - ss_addr_sk Int64 , - ss_store_sk Int64 , - ss_promo_sk Int64 , - ss_ticket_number Int64 {notnull}, - ss_quantity Int64 , - ss_wholesale_cost {decimal_7_2_type}, - ss_list_price {decimal_7_2_type}, - ss_sales_price {decimal_7_2_type}, - ss_ext_discount_amt {decimal_7_2_type}, - ss_ext_sales_price {decimal_7_2_type}, - ss_ext_wholesale_cost {decimal_7_2_type}, - ss_ext_list_price {decimal_7_2_type}, - ss_ext_tax {decimal_7_2_type}, - ss_coupon_amt {decimal_7_2_type}, - ss_net_paid {decimal_7_2_type}, - ss_net_paid_inc_tax {decimal_7_2_type}, - ss_net_profit {decimal_7_2_type} - {primary_key} (ss_item_sk, ss_ticket_number) -) -{partition_by}(ss_item_sk, ss_ticket_number) -WITH ( -{store}"{s3_prefix}/store_sales/", -{partitioning} = 64 -); diff --git a/ydb/library/workload/tpcds/tpcds_schema.yaml b/ydb/library/workload/tpcds/tpcds_schema.yaml new file mode 100644 index 000000000000..2d2c051c2b34 --- /dev/null +++ b/ydb/library/workload/tpcds/tpcds_schema.yaml @@ -0,0 +1,1010 @@ +tables: + - name: customer_address + columns: + - name: ca_address_sk + type: Int64 + not_null: true + - name: ca_address_id + type: string_type + - name: ca_street_number + type: string_type + - name: ca_street_name + type: string_type + - name: ca_street_type + type: string_type + - name: ca_suite_number + type: string_type + - name: ca_city + type: string_type + - name: ca_county + type: string_type + - name: ca_state + type: string_type + - name: ca_zip + type: string_type + - name: ca_country + type: string_type + - name: ca_gmt_offset + type: decimal_5_2_type + - name: ca_location_type + type: string_type + primary_key: + - ca_address_sk + + - name: customer_demographics + columns: + - name: cd_demo_sk + type: Int64 + not_null: true + - name: cd_gender + type: string_type + - name: cd_marital_status + type: string_type + - name: cd_education_status + type: string_type + - name: cd_purchase_estimate + type: Int64 + - name: cd_credit_rating + type: string_type + - name: cd_dep_count + type: Int64 + - name: cd_dep_employed_count + type: Int64 + - name: cd_dep_college_count + type: Int64 + primary_key: + - cd_demo_sk + + - name: date_dim + columns: + - name: d_date_sk + type: Int64 + not_null: true + - name: d_date_id + type: string_type + - name: d_date + type: string_type + - name: d_month_seq + type: Int64 + - name: d_week_seq + type: Int64 + - name: d_quarter_seq + type: Int64 + - name: d_year + type: Int64 + - name: d_dow + type: Int64 + - name: d_moy + type: Int64 + - name: d_dom + type: Int64 + - name: d_qoy + type: Int64 + - name: d_fy_year + type: Int64 + - name: d_fy_quarter_seq + type: Int64 + - name: d_fy_week_seq + type: Int64 + - name: d_day_name + type: string_type + - name: d_quarter_name + type: string_type + - name: d_holiday + type: string_type + - name: d_weekend + type: string_type + - name: d_following_holiday + type: string_type + - name: d_first_dom + type: Int64 + - name: d_last_dom + type: Int64 + - name: d_same_day_ly + type: Int64 + - name: d_same_day_lq + type: Int64 + - name: d_current_day + type: string_type + - name: d_current_week + type: string_type + - name: d_current_month + type: string_type + - name: d_current_quarter + type: string_type + - name: d_current_year + type: string_type + primary_key: + - d_date_sk + + - name: warehouse + columns: + - name: w_warehouse_sk + type: Int64 + not_null: true + - name: w_warehouse_id + type: string_type + - name: w_warehouse_name + type: string_type + - name: w_warehouse_sq_ft + type: Int64 + - name: w_street_number + type: string_type + - name: w_street_name + type: string_type + - name: w_street_type + type: string_type + - name: w_suite_number + type: string_type + - name: w_city + type: string_type + - name: w_county + type: string_type + - name: w_state + type: string_type + - name: w_zip + type: string_type + - name: w_country + type: string_type + - name: w_gmt_offset + type: decimal_5_2_type + primary_key: + - w_warehouse_sk + + - name: ship_mode + columns: + - name: sm_ship_mode_sk + type: Int64 + not_null: true + - name: sm_ship_mode_id + type: string_type + - name: sm_type + type: string_type + - name: sm_code + type: string_type + - name: sm_carrier + type: string_type + - name: sm_contract + type: string_type + primary_key: + - sm_ship_mode_sk + + - name: time_dim + columns: + - name: t_time_sk + type: Int64 + not_null: true + - name: t_time_id + type: string_type + - name: t_time + type: Int64 + - name: t_hour + type: Int64 + - name: t_minute + type: Int64 + - name: t_second + type: Int64 + - name: t_am_pm + type: string_type + - name: t_shift + type: string_type + - name: t_sub_shift + type: string_type + - name: t_meal_time + type: string_type + primary_key: + - t_time_sk + + - name: reason + columns: + - name: r_reason_sk + type: Int64 + not_null: true + - name: r_reason_id + type: string_type + - name: r_reason_desc + type: string_type + primary_key: + - r_reason_sk + + - name: income_band + columns: + - name: ib_income_band_sk + type: Int64 + not_null: true + - name: ib_lower_bound + type: Int64 + - name: ib_upper_bound + type: Int64 + primary_key: + - ib_income_band_sk + + - name: item + columns: + - name: i_item_sk + type: Int64 + not_null: true + - name: i_item_id + type: string_type + - name: i_rec_start_date + type: date_type + - name: i_rec_end_date + type: date_type + - name: i_item_desc + type: string_type + - name: i_current_price + type: decimal_7_2_type + - name: i_wholesale_cost + type: decimal_7_2_type + - name: i_brand_id + type: Int64 + - name: i_brand + type: string_type + - name: i_class_id + type: Int64 + - name: i_class + type: string_type + - name: i_category_id + type: Int64 + - name: i_category + type: string_type + - name: i_manufact_id + type: Int64 + - name: i_manufact + type: string_type + - name: i_size + type: string_type + - name: i_formulation + type: string_type + - name: i_color + type: string_type + - name: i_units + type: string_type + - name: i_container + type: string_type + - name: i_manager_id + type: Int64 + - name: i_product_name + type: string_type + primary_key: + - i_item_sk + + - name: store + columns: + - name: s_store_sk + type: Int64 + not_null: true + - name: s_store_id + type: string_type + - name: s_rec_start_date + type: date_type + - name: s_rec_end_date + type: date_type + - name: s_closed_date_sk + type: Int64 + - name: s_store_name + type: string_type + - name: s_number_employees + type: Int64 + - name: s_floor_space + type: Int64 + - name: s_hours + type: string_type + - name: s_manager + type: string_type + - name: s_market_id + type: Int64 + - name: s_geography_class + type: string_type + - name: s_market_desc + type: string_type + - name: s_market_manager + type: string_type + - name: s_division_id + type: Int64 + - name: s_division_name + type: string_type + - name: s_company_id + type: Int64 + - name: s_company_name + type: string_type + - name: s_street_number + type: string_type + - name: s_street_name + type: string_type + - name: s_street_type + type: string_type + - name: s_suite_number + type: string_type + - name: s_city + type: string_type + - name: s_county + type: string_type + - name: s_state + type: string_type + - name: s_zip + type: string_type + - name: s_country + type: string_type + - name: s_gmt_offset + type: decimal_5_2_type + - name: s_tax_precentage + type: decimal_5_2_type + primary_key: + - s_store_sk + + - name: call_center + columns: + - name: cc_call_center_sk + type: Int64 + not_null: true + - name: cc_call_center_id + type: string_type + - name: cc_rec_start_date + type: date_type + - name: cc_rec_end_date + type: date_type + - name: cc_closed_date_sk + type: Int64 + - name: cc_open_date_sk + type: Int64 + - name: cc_name + type: string_type + - name: cc_class + type: string_type + - name: cc_employees + type: Int64 + - name: cc_sq_ft + type: Int64 + - name: cc_hours + type: string_type + - name: cc_manager + type: string_type + - name: cc_mkt_id + type: Int64 + - name: cc_mkt_class + type: string_type + - name: cc_mkt_desc + type: string_type + - name: cc_market_manager + type: string_type + - name: cc_division + type: Int64 + - name: cc_division_name + type: string_type + - name: cc_company + type: Int64 + - name: cc_company_name + type: string_type + - name: cc_street_number + type: string_type + - name: cc_street_name + type: string_type + - name: cc_street_type + type: string_type + - name: cc_suite_number + type: string_type + - name: cc_city + type: string_type + - name: cc_county + type: string_type + - name: cc_state + type: string_type + - name: cc_zip + type: string_type + - name: cc_country + type: string_type + - name: cc_gmt_offset + type: decimal_5_2_type + - name: cc_tax_percentage + type: decimal_5_2_type + primary_key: + - cc_call_center_sk + + - name: customer + columns: + - name: c_customer_sk + type: Int64 + not_null: true + - name: c_customer_id + type: string_type + - name: c_current_cdemo_sk + type: Int64 + - name: c_current_hdemo_sk + type: Int64 + - name: c_current_addr_sk + type: Int64 + - name: c_first_shipto_date_sk + type: Int64 + - name: c_first_sales_date_sk + type: Int64 + - name: c_salutation + type: string_type + - name: c_first_name + type: string_type + - name: c_last_name + type: string_type + - name: c_preferred_cust_flag + type: string_type + - name: c_birth_day + type: Int64 + - name: c_birth_month + type: Int64 + - name: c_birth_year + type: Int64 + - name: c_birth_country + type: string_type + - name: c_login + type: string_type + - name: c_email_address + type: string_type + - name: c_last_review_date + type: string_type + primary_key: + - c_customer_sk + + - name: web_site + columns: + - name: web_site_sk + type: Int64 + not_null: true + - name: web_site_id + type: string_type + - name: web_rec_start_date + type: date_type + - name: web_rec_end_date + type: date_type + - name: web_name + type: string_type + - name: web_open_date_sk + type: Int64 + - name: web_close_date_sk + type: Int64 + - name: web_class + type: string_type + - name: web_manager + type: string_type + - name: web_mkt_id + type: Int64 + - name: web_mkt_class + type: string_type + - name: web_mkt_desc + type: string_type + - name: web_market_manager + type: string_type + - name: web_company_id + type: Int64 + - name: web_company_name + type: string_type + - name: web_street_number + type: string_type + - name: web_street_name + type: string_type + - name: web_street_type + type: string_type + - name: web_suite_number + type: string_type + - name: web_city + type: string_type + - name: web_county + type: string_type + - name: web_state + type: string_type + - name: web_zip + type: string_type + - name: web_country + type: string_type + - name: web_gmt_offset + type: decimal_5_2_type + - name: web_tax_percentage + type: decimal_5_2_type + primary_key: + - web_site_sk + + - name: store_returns + columns: + - name: sr_returned_date_sk + type: Int64 + - name: sr_return_time_sk + type: Int64 + - name: sr_item_sk + type: Int64 + not_null: true + - name: sr_customer_sk + type: Int64 + - name: sr_cdemo_sk + type: Int64 + - name: sr_hdemo_sk + type: Int64 + - name: sr_addr_sk + type: Int64 + - name: sr_store_sk + type: Int64 + - name: sr_reason_sk + type: Int64 + - name: sr_ticket_number + type: Int64 + not_null: true + - name: sr_return_quantity + type: Int64 + - name: sr_return_amt + type: decimal_7_2_type + - name: sr_return_tax + type: decimal_7_2_type + - name: sr_return_amt_inc_tax + type: decimal_7_2_type + - name: sr_fee + type: decimal_7_2_type + - name: sr_return_ship_cost + type: decimal_15_2_type + - name: sr_refunded_cash + type: decimal_7_2_type + - name: sr_reversed_charge + type: decimal_7_2_type + - name: sr_store_credit + type: decimal_7_2_type + - name: sr_net_loss + type: decimal_7_2_type + primary_key: + - sr_item_sk + - sr_ticket_number + + - name: household_demographics + columns: + - name: hd_demo_sk + type: Int64 + not_null: true + - name: hd_income_band_sk + type: Int64 + - name: hd_buy_potential + type: string_type + - name: hd_dep_count + type: Int64 + - name: hd_vehicle_count + type: Int64 + primary_key: + - hd_demo_sk + + - name: web_page + columns: + - name: wp_web_page_sk + type: Int64 + not_null: true + - name: wp_web_page_id + type: string_type + - name: wp_rec_start_date + type: date_type + - name: wp_rec_end_date + type: date_type + - name: wp_creation_date_sk + type: Int64 + - name: wp_access_date_sk + type: Int64 + - name: wp_autogen_flag + type: string_type + - name: wp_customer_sk + type: Int64 + - name: wp_url + type: string_type + - name: wp_type + type: string_type + - name: wp_char_count + type: Int64 + - name: wp_link_count + type: Int64 + - name: wp_image_count + type: Int64 + - name: wp_max_ad_count + type: Int64 + primary_key: + - wp_web_page_sk + + - name: promotion + columns: + - name: p_promo_sk + type: Int64 + not_null: true + - name: p_promo_id + type: string_type + - name: p_start_date_sk + type: Int64 + - name: p_end_date_sk + type: Int64 + - name: p_item_sk + type: Int64 + - name: p_cost + type: decimal_7_2_type + - name: p_response_target + type: Int64 + - name: p_promo_name + type: string_type + - name: p_channel_dmail + type: string_type + - name: p_channel_email + type: string_type + - name: p_channel_catalog + type: string_type + - name: p_channel_tv + type: string_type + - name: p_channel_radio + type: string_type + - name: p_channel_press + type: string_type + - name: p_channel_event + type: string_type + - name: p_channel_demo + type: string_type + - name: p_channel_details + type: string_type + - name: p_purpose + type: string_type + - name: p_discount_active + type: string_type + primary_key: + - p_promo_sk + + - name: catalog_page + columns: + - name: cp_catalog_page_sk + type: Int64 + not_null: true + - name: cp_catalog_page_id + type: string_type + - name: cp_start_date_sk + type: Int64 + - name: cp_end_date_sk + type: Int64 + - name: cp_department + type: string_type + - name: cp_catalog_number + type: Int64 + - name: cp_catalog_page_number + type: Int64 + - name: cp_description + type: string_type + - name: cp_type + type: string_type + primary_key: + - cp_catalog_page_sk + + - name: inventory + columns: + - name: inv_date_sk + type: Int64 + not_null: true + - name: inv_item_sk + type: Int64 + not_null: true + - name: inv_warehouse_sk + type: Int64 + not_null: true + - name: inv_quantity_on_hand + type: Int64 + primary_key: + - inv_date_sk + - inv_item_sk + - inv_warehouse_sk + + - name: catalog_returns + columns: + - name: cr_returned_date_sk + type: Int64 + - name: cr_returned_time_sk + type: Int64 + - name: cr_item_sk + type: Int64 + not_null: true + - name: cr_refunded_customer_sk + type: Int64 + - name: cr_refunded_cdemo_sk + type: Int64 + - name: cr_refunded_hdemo_sk + type: Int64 + - name: cr_refunded_addr_sk + type: Int64 + - name: cr_returning_customer_sk + type: Int64 + - name: cr_returning_cdemo_sk + type: Int64 + - name: cr_returning_hdemo_sk + type: Int64 + - name: cr_returning_addr_sk + type: Int64 + - name: cr_call_center_sk + type: Int64 + - name: cr_catalog_page_sk + type: Int64 + - name: cr_ship_mode_sk + type: Int64 + - name: cr_warehouse_sk + type: Int64 + - name: cr_reason_sk + type: Int64 + - name: cr_order_number + type: Int64 + not_null: true + - name: cr_return_quantity + type: Int64 + - name: cr_return_amount + type: decimal_7_2_type + - name: cr_return_tax + type: decimal_7_2_type + - name: cr_return_amt_inc_tax + type: decimal_7_2_type + - name: cr_fee + type: decimal_7_2_type + - name: cr_return_ship_cost + type: decimal_7_2_type + - name: cr_refunded_cash + type: decimal_7_2_type + - name: cr_reversed_charge + type: decimal_7_2_type + - name: cr_store_credit + type: decimal_7_2_type + - name: cr_net_loss + type: decimal_7_2_type + primary_key: + - cr_item_sk + - cr_order_number + + - name: web_returns + columns: + - name: wr_returned_date_sk + type: Int64 + - name: wr_returned_time_sk + type: Int64 + - name: wr_item_sk + type: Int64 + not_null: true + - name: wr_refunded_customer_sk + type: Int64 + - name: wr_refunded_cdemo_sk + type: Int64 + - name: wr_refunded_hdemo_sk + type: Int64 + - name: wr_refunded_addr_sk + type: Int64 + - name: wr_returning_customer_sk + type: Int64 + - name: wr_returning_cdemo_sk + type: Int64 + - name: wr_returning_hdemo_sk + type: Int64 + - name: wr_returning_addr_sk + type: Int64 + - name: wr_web_page_sk + type: Int64 + - name: wr_reason_sk + type: Int64 + - name: wr_order_number + type: Int64 + not_null: true + - name: wr_return_quantity + type: Int64 + - name: wr_return_amt + type: decimal_7_2_type + - name: wr_return_tax + type: decimal_7_2_type + - name: wr_return_amt_inc_tax + type: decimal_7_2_type + - name: wr_fee + type: decimal_7_2_type + - name: wr_return_ship_cost + type: decimal_7_2_type + - name: wr_refunded_cash + type: decimal_7_2_type + - name: wr_reversed_charge + type: decimal_7_2_type + - name: wr_account_credit + type: decimal_7_2_type + - name: wr_net_loss + type: decimal_7_2_type + primary_key: + - wr_item_sk + - wr_order_number + + - name: web_sales + columns: + - name: ws_sold_date_sk + type: Int64 + - name: ws_sold_time_sk + type: Int64 + - name: ws_ship_date_sk + type: Int64 + - name: ws_item_sk + type: Int64 + not_null: true + - name: ws_bill_customer_sk + type: Int64 + - name: ws_bill_cdemo_sk + type: Int64 + - name: ws_bill_hdemo_sk + type: Int64 + - name: ws_bill_addr_sk + type: Int64 + - name: ws_ship_customer_sk + type: Int64 + - name: ws_ship_cdemo_sk + type: Int64 + - name: ws_ship_hdemo_sk + type: Int64 + - name: ws_ship_addr_sk + type: Int64 + - name: ws_web_page_sk + type: Int64 + - name: ws_web_site_sk + type: Int64 + - name: ws_ship_mode_sk + type: Int64 + - name: ws_warehouse_sk + type: Int64 + - name: ws_promo_sk + type: Int64 + - name: ws_order_number + type: Int64 + not_null: true + - name: ws_quantity + type: Int64 + - name: ws_wholesale_cost + type: decimal_7_2_type + - name: ws_list_price + type: decimal_7_2_type + - name: ws_sales_price + type: decimal_7_2_type + - name: ws_ext_discount_amt + type: decimal_7_2_type + - name: ws_ext_sales_price + type: decimal_7_2_type + - name: ws_ext_wholesale_cost + type: decimal_7_2_type + - name: ws_ext_list_price + type: decimal_7_2_type + - name: ws_ext_tax + type: decimal_7_2_type + - name: ws_coupon_amt + type: decimal_7_2_type + - name: ws_ext_ship_cost + type: decimal_7_2_type + - name: ws_net_paid + type: decimal_7_2_type + - name: ws_net_paid_inc_tax + type: decimal_7_2_type + - name: ws_net_paid_inc_ship + type: decimal_7_2_type + - name: ws_net_paid_inc_ship_tax + type: decimal_7_2_type + - name: ws_net_profit + type: decimal_7_2_type + primary_key: + - ws_item_sk + - ws_order_number + + - name: catalog_sales + columns: + - name: cs_sold_date_sk + type: Int64 + - name: cs_sold_time_sk + type: Int64 + - name: cs_ship_date_sk + type: Int64 + - name: cs_bill_customer_sk + type: Int64 + - name: cs_bill_cdemo_sk + type: Int64 + - name: cs_bill_hdemo_sk + type: Int64 + - name: cs_bill_addr_sk + type: Int64 + - name: cs_ship_customer_sk + type: Int64 + - name: cs_ship_cdemo_sk + type: Int64 + - name: cs_ship_hdemo_sk + type: Int64 + - name: cs_ship_addr_sk + type: Int64 + - name: cs_call_center_sk + type: Int64 + - name: cs_catalog_page_sk + type: Int64 + - name: cs_ship_mode_sk + type: Int64 + - name: cs_warehouse_sk + type: Int64 + - name: cs_item_sk + type: Int64 + not_null: true + - name: cs_promo_sk + type: Int64 + - name: cs_order_number + type: Int64 + not_null: true + - name: cs_quantity + type: Int64 + - name: cs_wholesale_cost + type: decimal_7_2_type + - name: cs_list_price + type: decimal_7_2_type + - name: cs_sales_price + type: decimal_7_2_type + - name: cs_ext_discount_amt + type: decimal_7_2_type + - name: cs_ext_sales_price + type: decimal_7_2_type + - name: cs_ext_wholesale_cost + type: decimal_7_2_type + - name: cs_ext_list_price + type: decimal_7_2_type + - name: cs_ext_tax + type: decimal_7_2_type + - name: cs_coupon_amt + type: decimal_7_2_type + - name: cs_ext_ship_cost + type: decimal_7_2_type + - name: cs_net_paid + type: decimal_7_2_type + - name: cs_net_paid_inc_tax + type: decimal_7_2_type + - name: cs_net_paid_inc_ship + type: decimal_7_2_type + - name: cs_net_paid_inc_ship_tax + type: decimal_7_2_type + - name: cs_net_profit + type: decimal_7_2_type + primary_key: + - cs_item_sk + - cs_order_number + + - name: store_sales + columns: + - name: ss_sold_date_sk + type: Int64 + - name: ss_sold_time_sk + type: Int64 + - name: ss_item_sk + type: Int64 + not_null: true + - name: ss_customer_sk + type: Int64 + - name: ss_cdemo_sk + type: Int64 + - name: ss_hdemo_sk + type: Int64 + - name: ss_addr_sk + type: Int64 + - name: ss_store_sk + type: Int64 + - name: ss_promo_sk + type: Int64 + - name: ss_ticket_number + type: Int64 + not_null: true + - name: ss_quantity + type: Int64 + - name: ss_wholesale_cost + type: decimal_7_2_type + - name: ss_list_price + type: decimal_7_2_type + - name: ss_sales_price + type: decimal_7_2_type + - name: ss_ext_discount_amt + type: decimal_7_2_type + - name: ss_ext_sales_price + type: decimal_7_2_type + - name: ss_ext_wholesale_cost + type: decimal_7_2_type + - name: ss_ext_list_price + type: decimal_7_2_type + - name: ss_ext_tax + type: decimal_7_2_type + - name: ss_coupon_amt + type: decimal_7_2_type + - name: ss_net_paid + type: decimal_7_2_type + - name: ss_net_paid_inc_tax + type: decimal_7_2_type + - name: ss_net_profit + type: decimal_7_2_type + primary_key: + - ss_item_sk + - ss_ticket_number diff --git a/ydb/library/workload/tpcds/ya.make b/ydb/library/workload/tpcds/ya.make index cd525f0175bf..e856c18e362a 100644 --- a/ydb/library/workload/tpcds/ya.make +++ b/ydb/library/workload/tpcds/ya.make @@ -39,7 +39,7 @@ SRCS( ) RESOURCE( - tpcds_schema.sql tpcds_schema.sql + tpcds_schema.yaml tpcds_schema.yaml ) ALL_RESOURCE_FILES_FROM_DIRS( diff --git a/ydb/library/workload/tpch/tpch.cpp b/ydb/library/workload/tpch/tpch.cpp index 685c4bc14a97..183f3a0e7b13 100644 --- a/ydb/library/workload/tpch/tpch.cpp +++ b/ydb/library/workload/tpch/tpch.cpp @@ -13,37 +13,22 @@ TTpchWorkloadGenerator::TTpchWorkloadGenerator(const TTpchWorkloadParams& params , Params(params) {} -TString TTpchWorkloadGenerator::DoGetDDLQueries() const { - auto schema = NResource::Find("tpch_schema.sql"); - TString floatType; +TString TTpchWorkloadGenerator::GetTablesYaml() const { + return NResource::Find("tpch_schema.yaml"); +} + +TWorkloadGeneratorBase::TSpecialDataTypes TTpchWorkloadGenerator::GetSpecialDataTypes() const { switch (Params.GetFloatMode()) { case TTpcBaseWorkloadParams::EFloatMode::FLOAT: - floatType = "Double"; - break; + return {{"float_type", "Double"}}; case TTpcBaseWorkloadParams::EFloatMode::DECIMAL: - floatType = "Decimal(12,2)"; - break; + return {{"float_type", "Decimal(12,2)"}}; case TTpcBaseWorkloadParams::EFloatMode::DECIMAL_YDB: - floatType = "Decimal(" + ::ToString(NKikimr::NScheme::DECIMAL_PRECISION) - + "," + ::ToString(NKikimr::NScheme::DECIMAL_SCALE) + ")"; - break; + return {{"float_type", "Decimal(" + ::ToString(NKikimr::NScheme::DECIMAL_PRECISION) + + "," + ::ToString(NKikimr::NScheme::DECIMAL_SCALE) + ")"}}; } - SubstGlobal(schema, "{float_type}", floatType); - return schema; } -TVector TTpchWorkloadGenerator::GetTablesList() const { - return { - "customer", - "lineitem", - "nation", - "orders", - "part", - "partsupp", - "region", - "supplier" - }; -} THolder TTpchWorkloadParams::CreateGenerator() const { return MakeHolder(*this); diff --git a/ydb/library/workload/tpch/tpch.h b/ydb/library/workload/tpch/tpch.h index 9f87bb95fe4c..bfe5506c493d 100644 --- a/ydb/library/workload/tpch/tpch.h +++ b/ydb/library/workload/tpch/tpch.h @@ -17,8 +17,8 @@ class TTpchWorkloadGenerator final: public TTpcBaseWorkloadGenerator { explicit TTpchWorkloadGenerator(const TTpchWorkloadParams& params); protected: - TString DoGetDDLQueries() const override; - TVector GetTablesList() const override; + TString GetTablesYaml() const override; + TWorkloadGeneratorBase::TSpecialDataTypes GetSpecialDataTypes() const override; private: const TTpchWorkloadParams& Params; diff --git a/ydb/library/workload/tpch/tpch_schema.sql b/ydb/library/workload/tpch/tpch_schema.sql deleted file mode 100644 index cd3ca5772893..000000000000 --- a/ydb/library/workload/tpch/tpch_schema.sql +++ /dev/null @@ -1,127 +0,0 @@ -{createExternal} - -CREATE {external} TABLE `{path}/customer` ( - c_acctbal {float_type} {notnull}, -- it should be Decimal(12, 2) - c_address {string_type} {notnull}, - c_comment {string_type} {notnull}, - c_custkey Int64 {notnull}, -- Identifier - c_mktsegment {string_type} {notnull}, - c_name {string_type} {notnull}, - c_nationkey Int32 {notnull}, -- FK to N_NATIONKEY - c_phone {string_type} {notnull} - {primary_key} (c_custkey) -) -{partition_by}(c_custkey) -WITH ({store}"{s3_prefix}/customer/" -{partitioning} = 64 -); - -CREATE {external} TABLE `{path}/lineitem` ( - l_comment {string_type} {notnull}, - l_commitdate {date_type} {notnull}, - l_discount {float_type} {notnull}, -- it should be Decimal(12, 2) - l_extendedprice {float_type} {notnull}, -- it should be Decimal(12, 2) - l_linenumber Int32 {notnull}, - l_linestatus {string_type} {notnull}, - l_orderkey Int64 {notnull}, -- FK to O_ORDERKEY - l_partkey Int64 {notnull}, -- FK to P_PARTKEY, first part of the compound FK to (PS_PARTKEY, PS_SUPPKEY) with L_SUPPKEY - l_quantity {float_type} {notnull}, -- it should be Decimal(12, 2) - l_receiptdate {date_type} {notnull}, - l_returnflag {string_type} {notnull}, - l_shipdate {date_type} {notnull}, - l_shipinstruct {string_type} {notnull}, - l_shipmode {string_type} {notnull}, - l_suppkey Int64 {notnull}, -- FK to S_SUPPKEY, second part of the compound FK to (PS_PARTKEY, PS_SUPPKEY) with L_PARTKEY - l_tax {float_type} {notnull} -- it should be Decimal(12, 2) - {primary_key} (l_orderkey, l_linenumber) -) -{partition_by}(l_orderkey) -WITH ({store}"{s3_prefix}/lineitem/" -{partitioning} = 64 -); - -CREATE {external} TABLE `{path}/nation` ( - n_comment {string_type} {notnull}, - n_name {string_type} {notnull}, - n_nationkey Int32 {notnull}, -- Identifier - n_regionkey Int32 {notnull} -- FK to R_REGIONKEY - {primary_key}(n_nationkey) -) -{partition_by}(n_nationkey) - -WITH ({store}"{s3_prefix}/nation/" -{partitioning} = 1 -); - -CREATE {external} TABLE `{path}/orders` ( - o_clerk {string_type} {notnull}, - o_comment {string_type} {notnull}, - o_custkey Int64 {notnull}, -- FK to C_CUSTKEY - o_orderdate {date_type} {notnull}, - o_orderkey Int64 {notnull}, -- Identifier - o_orderpriority {string_type} {notnull}, - o_orderstatus {string_type} {notnull}, - o_shippriority Int32 {notnull}, - o_totalprice {float_type} {notnull} -- it should be Decimal(12, 2) - {primary_key} (o_orderkey) -) -{partition_by}(o_orderkey) -WITH ({store}"{s3_prefix}/orders/" -{partitioning} = 64 -); - -CREATE {external} TABLE `{path}/part` ( - p_brand {string_type} {notnull}, - p_comment {string_type} {notnull}, - p_container {string_type} {notnull}, - p_mfgr {string_type} {notnull}, - p_name {string_type} {notnull}, - p_partkey Int64 {notnull}, -- Identifier - p_retailprice {float_type} {notnull}, -- it should be Decimal(12, 2) - p_size Int32 {notnull}, - p_type {string_type} {notnull} - {primary_key}(p_partkey) -) -{partition_by}(p_partkey) -WITH ({store}"{s3_prefix}/part/" -{partitioning} = 64 -); - -CREATE {external} TABLE `{path}/partsupp` ( - ps_availqty Int32 {notnull}, - ps_comment {string_type} {notnull}, - ps_partkey Int64 {notnull}, -- FK to P_PARTKEY - ps_suppkey Int64 {notnull}, -- FK to S_SUPPKEY - ps_supplycost {float_type} {notnull} -- it should be Decimal(12, 2) - {primary_key}(ps_partkey, ps_suppkey) -) -{partition_by}(ps_partkey) -WITH ({store}"{s3_prefix}/partsupp/" -{partitioning} = 64 -); - -CREATE {external} TABLE `{path}/region` ( - r_comment {string_type} {notnull}, - r_name {string_type} {notnull}, - r_regionkey Int32 {notnull} -- Identifier - {primary_key}(r_regionkey) -) -{partition_by}(r_regionkey) -WITH ({store}"{s3_prefix}/region/" -{partitioning} = 1 -); - -CREATE {external} TABLE `{path}/supplier` ( - s_acctbal {float_type} {notnull}, -- it should be Decimal(12, 2) - s_address {string_type} {notnull}, - s_comment {string_type} {notnull}, - s_name {string_type} {notnull}, - s_nationkey Int32 {notnull}, -- FK to N_NATIONKEY - s_phone {string_type} {notnull}, - s_suppkey Int64 {notnull} -- Identifier - {primary_key}(s_suppkey) -) -{partition_by}(s_suppkey) -WITH ({store}"{s3_prefix}/supplier/" -{partitioning} = 64 -); diff --git a/ydb/library/workload/tpch/tpch_schema.yaml b/ydb/library/workload/tpch/tpch_schema.yaml new file mode 100644 index 000000000000..24b4c48c44e1 --- /dev/null +++ b/ydb/library/workload/tpch/tpch_schema.yaml @@ -0,0 +1,226 @@ +tables: + - name: customer + columns: + - name: c_acctbal + type: float_type + not_null: true + - name: c_address + type: string_type + not_null: true + - name: c_comment + type: string_type + not_null: true + - name: c_custkey + type: Int64 + not_null: true + - name: c_mktsegment + type: string_type + not_null: true + - name: c_name + type: string_type + not_null: true + - name: c_nationkey + type: Int32 + not_null: true + - name: c_phone + type: string_type + not_null: true + primary_key: + - c_custkey + + - name: lineitem + columns: + - name: l_comment + type: string_type + not_null: true + - name: l_commitdate + type: date_type + not_null: true + - name: l_discount + type: float_type + not_null: true + - name: l_extendedprice + type: float_type + not_null: true + - name: l_linenumber + type: Int32 + not_null: true + - name: l_linestatus + type: string_type + not_null: true + - name: l_orderkey + type: Int64 + not_null: true + - name: l_partkey + type: Int64 + not_null: true + - name: l_quantity + type: float_type + not_null: true + - name: l_receiptdate + type: date_type + not_null: true + - name: l_returnflag + type: string_type + not_null: true + - name: l_shipdate + type: date_type + not_null: true + - name: l_shipinstruct + type: string_type + not_null: true + - name: l_shipmode + type: string_type + not_null: true + - name: l_suppkey + type: Int64 + not_null: true + - name: l_tax + type: float_type + not_null: true + primary_key: + - l_orderkey + - l_linenumber + + - name: nation + columns: + - name: n_comment + type: string_type + not_null: true + - name: n_name + type: string_type + not_null: true + - name: n_nationkey + type: Int32 + not_null: true + - name: n_regionkey + type: Int32 + not_null: true + primary_key: + - n_nationkey + partitioning: 1 + + - name: orders + columns: + - name: o_clerk + type: string_type + not_null: true + - name: o_comment + type: string_type + not_null: true + - name: o_custkey + type: Int64 + not_null: true + - name: o_orderdate + type: date_type + not_null: true + - name: o_orderkey + type: Int64 + not_null: true + - name: o_orderpriority + type: string_type + not_null: true + - name: o_orderstatus + type: string_type + not_null: true + - name: o_shippriority + type: Int32 + not_null: true + - name: o_totalprice + type: float_type + not_null: true + primary_key: + - o_orderkey + + - name: part + columns: + - name: p_brand + type: string_type + not_null: true + - name: p_comment + type: string_type + not_null: true + - name: p_container + type: string_type + not_null: true + - name: p_mfgr + type: string_type + not_null: true + - name: p_name + type: string_type + not_null: true + - name: p_partkey + type: Int64 + not_null: true + - name: p_retailprice + type: float_type + not_null: true + - name: p_size + type: Int32 + not_null: true + - name: p_type + type: string_type + not_null: true + primary_key: + - p_partkey + + - name: partsupp + columns: + - name: ps_availqty + type: Int32 + not_null: true + - name: ps_comment + type: string_type + not_null: true + - name: ps_partkey + type: Int64 + not_null: true + - name: ps_suppkey + type: Int64 + not_null: true + - name: ps_supplycost + type: float_type + not_null: true + primary_key: + - ps_partkey + + - name: region + columns: + - name: r_comment + type: string_type + not_null: true + - name: r_name + type: string_type + not_null: true + - name: r_regionkey + type: Int32 + not_null: true + primary_key: + - r_regionkey + partitioning: 1 + + - name: supplier + columns: + - name: s_acctbal + type: float_type + not_null: true + - name: s_address + type: string_type + not_null: true + - name: s_comment + type: string_type + not_null: true + - name: s_name + type: string_type + not_null: true + - name: s_nationkey + type: Int32 + not_null: true + - name: s_phone + type: string_type + not_null: true + - name: s_suppkey + type: Int64 + not_null: true + primary_key: + - s_suppkey diff --git a/ydb/library/workload/tpch/ya.make b/ydb/library/workload/tpch/ya.make index 23d9fcab528f..635852a9ca56 100644 --- a/ydb/library/workload/tpch/ya.make +++ b/ydb/library/workload/tpch/ya.make @@ -19,7 +19,7 @@ ELSEIF (OS_LINUX) ENDIF() RESOURCE( - tpch_schema.sql tpch_schema.sql + tpch_schema.yaml tpch_schema.yaml ydb/library/benchmarks/gen/tpch-dbgen/dists.dss dists.dss ) @@ -34,8 +34,8 @@ ALL_RESOURCE_FILES_FROM_DIRS( PEERDIR( contrib/libs/fmt - ydb/library/accessor library/cpp/resource + ydb/library/accessor ydb/library/benchmarks/gen/tpch-dbgen ydb/library/benchmarks/queries/tpch ydb/library/workload/tpc_base diff --git a/ydb/library/ya.make b/ydb/library/ya.make index ad6f74e48a2b..ed6724d58eaa 100644 --- a/ydb/library/ya.make +++ b/ydb/library/ya.make @@ -34,7 +34,7 @@ RECURSE( workload workload yaml_config - yaml_config + yaml_json ycloud yql ) diff --git a/ydb/library/yaml_config/deprecated/yaml_config_parser.cpp b/ydb/library/yaml_config/deprecated/yaml_config_parser.cpp index 631fb599f7bf..8be2ad399317 100644 --- a/ydb/library/yaml_config/deprecated/yaml_config_parser.cpp +++ b/ydb/library/yaml_config/deprecated/yaml_config_parser.cpp @@ -5,20 +5,9 @@ #include #include - +#include namespace NKikimr::NYaml::NDeprecated { - template - static bool SetScalarFromYaml(const YAML::Node& yaml, NJson::TJsonValue& json, NJson::EJsonValueType jsonType) { - T data; - if (YAML::convert::decode(yaml, data)) { - json.SetType(jsonType); - json.SetValue(data); - return true; - } - return false; - } - static const TString& GetStringSafe(const NJson::TJsonValue& json, const TStringBuf& key) { auto& value = json[key]; Y_ENSURE_BT(value.IsString(), "Unexpected value for key: " << key << ", expected string value."); @@ -36,53 +25,6 @@ namespace NKikimr::NYaml::NDeprecated { Y_ENSURE_BT(json.Has(key) && json[key].IsArray(), "Array field `" << key << "` must be specified."); } - NJson::TJsonValue Yaml2Json(const YAML::Node& yaml, bool isRoot) { - Y_ENSURE_BT(!isRoot || yaml.IsMap(), "YAML root is expected to be a map"); - - NJson::TJsonValue json; - - if (yaml.IsMap()) { - for (const auto& it : yaml) { - const auto& key = it.first.as(); - - Y_ENSURE_BT(!json.Has(key), "Duplicate key entry: " << key); - - json[key] = Yaml2Json(it.second, false); - } - return json; - } else if (yaml.IsSequence()) { - json.SetType(NJson::EJsonValueType::JSON_ARRAY); - for (const auto& it : yaml) { - json.AppendValue(Yaml2Json(it, false)); - } - return json; - } else if (yaml.IsScalar()) { - if (SetScalarFromYaml(yaml, json, NJson::EJsonValueType::JSON_UINTEGER)) - return json; - - if (SetScalarFromYaml(yaml, json, NJson::EJsonValueType::JSON_INTEGER)) - return json; - - if (SetScalarFromYaml(yaml, json, NJson::EJsonValueType::JSON_BOOLEAN)) - return json; - - if (SetScalarFromYaml(yaml, json, NJson::EJsonValueType::JSON_DOUBLE)) - return json; - - if (SetScalarFromYaml(yaml, json, NJson::EJsonValueType::JSON_STRING)) - return json; - - } else if (yaml.IsNull()) { - json.SetType(NJson::EJsonValueType::JSON_NULL); - return json; - } else if (!yaml.IsDefined()) { - json.SetType(NJson::EJsonValueType::JSON_UNDEFINED); - return json; - } - - ythrow yexception() << "Unknown type of YAML node: '" << yaml.as() << "'"; - } - static NProtobufJson::TJson2ProtoConfig GetJsonToProtoConfig() { NProtobufJson::TJson2ProtoConfig config; config.SetFieldNameMode(NProtobufJson::TJson2ProtoConfig::FieldNameSnakeCaseDense); diff --git a/ydb/library/yaml_config/deprecated/yaml_config_parser.h b/ydb/library/yaml_config/deprecated/yaml_config_parser.h index 3e070803faae..b1991a74a69c 100644 --- a/ydb/library/yaml_config/deprecated/yaml_config_parser.h +++ b/ydb/library/yaml_config/deprecated/yaml_config_parser.h @@ -14,7 +14,6 @@ namespace NKikimr::NYaml::NDeprecated { - NJson::TJsonValue Yaml2Json(const YAML::Node& yaml, bool isRoot); NKikimrBlobStorage::TConfigRequest BuildInitDistributedStorageCommand(const TString& data); diff --git a/ydb/library/yaml_config/ut_transform/canondata/test_transform.TestYamlConfigTransformations.test_basic_args1-dump_ds_init_/nvme.yaml.result.json b/ydb/library/yaml_config/ut_transform/canondata/test_transform.TestYamlConfigTransformations.test_basic_args1-dump_ds_init_/nvme.yaml.result.json index 0cc3b9c35f05..df02ee3be2c9 100644 --- a/ydb/library/yaml_config/ut_transform/canondata/test_transform.TestYamlConfigTransformations.test_basic_args1-dump_ds_init_/nvme.yaml.result.json +++ b/ydb/library/yaml_config/ut_transform/canondata/test_transform.TestYamlConfigTransformations.test_basic_args1-dump_ds_init_/nvme.yaml.result.json @@ -1 +1 @@ -{"error": true, "stderr": "uncaught exception:\n address -> REDACTED\n what() -> \"ydb/library/yaml_config/deprecated/yaml_config_parser.cpp:913: Specify host_configs to use blobstorage init command\"\n type -> TWithBackTrace\n"} \ No newline at end of file +{"error": true, "stderr": "uncaught exception:\n address -> REDACTED\n what() -> \"ydb/library/yaml_config/deprecated/yaml_config_parser.cpp:855: Specify host_configs to use blobstorage init command\"\n type -> TWithBackTrace\n"} \ No newline at end of file diff --git a/ydb/library/yaml_config/ya.make b/ydb/library/yaml_config/ya.make index 24004bb1ba5a..0916c245d9bc 100644 --- a/ydb/library/yaml_config/ya.make +++ b/ydb/library/yaml_config/ya.make @@ -15,7 +15,6 @@ SRCS( PEERDIR( contrib/libs/openssl contrib/libs/protobuf - contrib/libs/yaml-cpp library/cpp/protobuf/json ydb/core/base ydb/core/cms/console/util @@ -26,6 +25,7 @@ PEERDIR( ydb/library/fyamlcpp ydb/library/yaml_config/protos ydb/library/yaml_config/public + ydb/library/yaml_json ) END() diff --git a/ydb/library/yaml_config/yaml_config_parser.cpp b/ydb/library/yaml_config/yaml_config_parser.cpp index c1e354881a77..4b0ec5b037b8 100644 --- a/ydb/library/yaml_config/yaml_config_parser.cpp +++ b/ydb/library/yaml_config/yaml_config_parser.cpp @@ -17,22 +17,12 @@ #include #include #include +#include #include namespace NKikimr::NYaml { - template - bool SetScalarFromYaml(const YAML::Node& yaml, NJson::TJsonValue& json, NJson::EJsonValueType jsonType) { - T data; - if (YAML::convert::decode(yaml, data)) { - json.SetType(jsonType); - json.SetValue(data); - return true; - } - return false; - } - const NJson::TJsonValue::TMapType& GetMapSafe(const NJson::TJsonValue& json) { try { return json.GetMapSafe(); @@ -51,57 +41,6 @@ namespace NKikimr::NYaml { Y_ENSURE_BT(json.Has(key) && GetMapSafe(json).at(key).IsArray(), "Array field `" << key << "` must be specified."); } - NJson::TJsonValue Yaml2Json(const YAML::Node& yaml, bool isRoot) { - Y_ENSURE_BT(!isRoot || yaml.IsMap(), "YAML root is expected to be a map"); - - NJson::TJsonValue json; - - if (yaml.IsMap()) { - for (const auto& it : yaml) { - const auto& key = it.first.as(); - - Y_ENSURE_BT(!json.Has(key), "Duplicate key entry: " << key); - - json[key] = Yaml2Json(it.second, false); - } - return json; - } else if (yaml.IsSequence()) { - json.SetType(NJson::EJsonValueType::JSON_ARRAY); - for (const auto& it : yaml) { - json.AppendValue(Yaml2Json(it, false)); - } - return json; - } else if (yaml.IsScalar()) { - if (SetScalarFromYaml(yaml, json, NJson::EJsonValueType::JSON_UINTEGER)) { - return json; - } - - if (SetScalarFromYaml(yaml, json, NJson::EJsonValueType::JSON_INTEGER)) { - return json; - } - - if (SetScalarFromYaml(yaml, json, NJson::EJsonValueType::JSON_BOOLEAN)) { - return json; - } - - if (SetScalarFromYaml(yaml, json, NJson::EJsonValueType::JSON_DOUBLE)) { - return json; - } - - if (SetScalarFromYaml(yaml, json, NJson::EJsonValueType::JSON_STRING)) { - return json; - } - } else if (yaml.IsNull()) { - json.SetType(NJson::EJsonValueType::JSON_NULL); - return json; - } else if (!yaml.IsDefined()) { - json.SetType(NJson::EJsonValueType::JSON_UNDEFINED); - return json; - } - - ythrow yexception() << "Unknown type of YAML node: '" << yaml.as() << "'"; - } - YAML::Node Json2Yaml(const NJson::TJsonValue& json) { YAML::Node yamlNode; yamlNode["host_configs"] = YAML::Node(YAML::NodeType::Sequence); diff --git a/ydb/library/yaml_json/ya.make b/ydb/library/yaml_json/ya.make new file mode 100644 index 000000000000..2135ac0e568f --- /dev/null +++ b/ydb/library/yaml_json/ya.make @@ -0,0 +1,12 @@ +LIBRARY() + +SRCS( + yaml_to_json.cpp +) + +PEERDIR( + library/cpp/json + library/cpp/yaml/as +) + +END() diff --git a/ydb/library/yaml_json/yaml_to_json.cpp b/ydb/library/yaml_json/yaml_to_json.cpp new file mode 100644 index 000000000000..753aa9875315 --- /dev/null +++ b/ydb/library/yaml_json/yaml_to_json.cpp @@ -0,0 +1,68 @@ +#include "yaml_to_json.h" +#include +#include + +namespace NKikimr::NYaml { + + template + bool SetScalarFromYaml(const YAML::Node& yaml, NJson::TJsonValue& json, NJson::EJsonValueType jsonType) { + T data; + if (YAML::convert::decode(yaml, data)) { + json.SetType(jsonType); + json.SetValue(data); + return true; + } + return false; + } + + NJson::TJsonValue Yaml2Json(const YAML::Node& yaml, bool isRoot) { + Y_ENSURE_BT(!isRoot || yaml.IsMap(), "YAML root is expected to be a map"); + + NJson::TJsonValue json; + + if (yaml.IsMap()) { + for (const auto& it : yaml) { + const auto& key = it.first.as(); + + Y_ENSURE_BT(!json.Has(key), "Duplicate key entry: " << key); + + json[key] = Yaml2Json(it.second, false); + } + return json; + } else if (yaml.IsSequence()) { + json.SetType(NJson::EJsonValueType::JSON_ARRAY); + for (const auto& it : yaml) { + json.AppendValue(Yaml2Json(it, false)); + } + return json; + } else if (yaml.IsScalar()) { + if (SetScalarFromYaml(yaml, json, NJson::EJsonValueType::JSON_UINTEGER)) { + return json; + } + + if (SetScalarFromYaml(yaml, json, NJson::EJsonValueType::JSON_INTEGER)) { + return json; + } + + if (SetScalarFromYaml(yaml, json, NJson::EJsonValueType::JSON_BOOLEAN)) { + return json; + } + + if (SetScalarFromYaml(yaml, json, NJson::EJsonValueType::JSON_DOUBLE)) { + return json; + } + + if (SetScalarFromYaml(yaml, json, NJson::EJsonValueType::JSON_STRING)) { + return json; + } + } else if (yaml.IsNull()) { + json.SetType(NJson::EJsonValueType::JSON_NULL); + return json; + } else if (!yaml.IsDefined()) { + json.SetType(NJson::EJsonValueType::JSON_UNDEFINED); + return json; + } + + ythrow yexception() << "Unknown type of YAML node: '" << yaml.as() << "'"; + } +} \ No newline at end of file diff --git a/ydb/library/yaml_json/yaml_to_json.h b/ydb/library/yaml_json/yaml_to_json.h new file mode 100644 index 000000000000..14beabda7a44 --- /dev/null +++ b/ydb/library/yaml_json/yaml_to_json.h @@ -0,0 +1,10 @@ +#pragma once + +#include +#include + +namespace NKikimr::NYaml { + + NJson::TJsonValue Yaml2Json(const YAML::Node& yaml, bool isRoot); + +} \ No newline at end of file diff --git a/ydb/tests/functional/tpc/canondata/test_init.TestClickbenchInit.test_s1_column/s1_column b/ydb/tests/functional/tpc/canondata/test_init.TestClickbenchInit.test_s1_column/s1_column index 9b727159abe4..b2fb42bf0879 100644 --- a/ydb/tests/functional/tpc/canondata/test_init.TestClickbenchInit.test_s1_column/s1_column +++ b/ydb/tests/functional/tpc/canondata/test_init.TestClickbenchInit.test_s1_column/s1_column @@ -1,9 +1,7 @@ Init tables ... --!syntax_v1 - -CREATE TABLE `/Root/db/Root/db/clickbench/s1` -( +CREATE TABLE `/Root/db/Root/db/clickbench/s1` ( WatchID Int64 NOT NULL, JavaEnable Int16 NOT NULL, Title Utf8 NOT NULL, @@ -108,13 +106,12 @@ CREATE TABLE `/Root/db/Root/db/clickbench/s1` HasGCLID Int16 NOT NULL, RefererHash Int64 NOT NULL, URLHash Int64 NOT NULL, - CLID Int32 NOT NULL - , PRIMARY KEY(CounterID, EventDate, UserID, EventTime, WatchID) + CLID Int32 NOT NULL, + PRIMARY KEY (CounterID, EventDate, UserID, EventTime, WatchID) ) -PARTITION BY HASH(CounterID, EventDate, UserID, EventTime, WatchID) +PARTITION BY HASH (CounterID, EventDate, UserID, EventTime, WatchID) WITH ( --- AUTO_PARTITIONING_BY_SIZE = "ENABLED", - STORE = COLUMN, --"/hits" + STORE = COLUMN, AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 128 ); diff --git a/ydb/tests/functional/tpc/canondata/test_init.TestClickbenchInit.test_s1_row/s1_row b/ydb/tests/functional/tpc/canondata/test_init.TestClickbenchInit.test_s1_row/s1_row index 40bbafbc2f2f..2d3dd3b06a86 100644 --- a/ydb/tests/functional/tpc/canondata/test_init.TestClickbenchInit.test_s1_row/s1_row +++ b/ydb/tests/functional/tpc/canondata/test_init.TestClickbenchInit.test_s1_row/s1_row @@ -1,120 +1,115 @@ Init tables ... --!syntax_v1 - -CREATE TABLE `/Root/db/Root/db/clickbench/s1` -( - WatchID Int64 , - JavaEnable Int16 , - Title Utf8 , - GoodEvent Int16 , - EventTime Timestamp64 , - EventDate Date32 , - CounterID Int32 , - ClientIP Int32 , - RegionID Int32 , - UserID Int64 , - CounterClass Int16 , - OS Int16 , - UserAgent Int16 , - URL Utf8 , - Referer Utf8 , - IsRefresh Int16 , - RefererCategoryID Int16 , - RefererRegionID Int32 , - URLCategoryID Int16 , - URLRegionID Int32 , - ResolutionWidth Int16 , - ResolutionHeight Int16 , - ResolutionDepth Int16 , - FlashMajor Int16 , - FlashMinor Int16 , - FlashMinor2 Utf8 , - NetMajor Int16 , - NetMinor Int16 , - UserAgentMajor Int16 , - UserAgentMinor Bytes , - CookieEnable Int16 , - JavascriptEnable Int16 , - IsMobile Int16 , - MobilePhone Int16 , - MobilePhoneModel Utf8 , - Params Utf8 , - IPNetworkID Int32 , - TraficSourceID Int16 , - SearchEngineID Int16 , - SearchPhrase Utf8 , - AdvEngineID Int16 , - IsArtifical Int16 , - WindowClientWidth Int16 , - WindowClientHeight Int16 , - ClientTimeZone Int16 , - ClientEventTime Timestamp64 , - SilverlightVersion1 Int16 , - SilverlightVersion2 Int16 , - SilverlightVersion3 Int32 , - SilverlightVersion4 Int16 , - PageCharset Utf8 , - CodeVersion Int32 , - IsLink Int16 , - IsDownload Int16 , - IsNotBounce Int16 , - FUniqID Int64 , - OriginalURL Utf8 , - HID Int32 , - IsOldCounter Int16 , - IsEvent Int16 , - IsParameter Int16 , - DontCountHits Int16 , - WithHash Int16 , - HitColor Utf8 , - LocalEventTime Timestamp64 , - Age Int16 , - Sex Int16 , - Income Int16 , - Interests Int16 , - Robotness Int16 , - RemoteIP Int32 , - WindowName Int32 , - OpenerName Int32 , - HistoryLength Int16 , - BrowserLanguage Utf8 , - BrowserCountry Utf8 , - SocialNetwork Utf8 , - SocialAction Utf8 , - HTTPError Int16 , - SendTiming Int32 , - DNSTiming Int32 , - ConnectTiming Int32 , - ResponseStartTiming Int32 , - ResponseEndTiming Int32 , - FetchTiming Int32 , - SocialSourceNetworkID Int16 , - SocialSourcePage Utf8 , - ParamPrice Int64 , - ParamOrderID Utf8 , - ParamCurrency Utf8 , - ParamCurrencyID Int16 , - OpenstatServiceName Utf8 , - OpenstatCampaignID Utf8 , - OpenstatAdID Utf8 , - OpenstatSourceID Utf8 , - UTMSource Utf8 , - UTMMedium Utf8 , - UTMCampaign Utf8 , - UTMContent Utf8 , - UTMTerm Utf8 , - FromTag Utf8 , - HasGCLID Int16 , - RefererHash Int64 , - URLHash Int64 , - CLID Int32 - , PRIMARY KEY(CounterID, EventDate, UserID, EventTime, WatchID) +CREATE TABLE `/Root/db/Root/db/clickbench/s1` ( + WatchID Int64, + JavaEnable Int16, + Title Utf8, + GoodEvent Int16, + EventTime Timestamp64, + EventDate Date32, + CounterID Int32, + ClientIP Int32, + RegionID Int32, + UserID Int64, + CounterClass Int16, + OS Int16, + UserAgent Int16, + URL Utf8, + Referer Utf8, + IsRefresh Int16, + RefererCategoryID Int16, + RefererRegionID Int32, + URLCategoryID Int16, + URLRegionID Int32, + ResolutionWidth Int16, + ResolutionHeight Int16, + ResolutionDepth Int16, + FlashMajor Int16, + FlashMinor Int16, + FlashMinor2 Utf8, + NetMajor Int16, + NetMinor Int16, + UserAgentMajor Int16, + UserAgentMinor Bytes, + CookieEnable Int16, + JavascriptEnable Int16, + IsMobile Int16, + MobilePhone Int16, + MobilePhoneModel Utf8, + Params Utf8, + IPNetworkID Int32, + TraficSourceID Int16, + SearchEngineID Int16, + SearchPhrase Utf8, + AdvEngineID Int16, + IsArtifical Int16, + WindowClientWidth Int16, + WindowClientHeight Int16, + ClientTimeZone Int16, + ClientEventTime Timestamp64, + SilverlightVersion1 Int16, + SilverlightVersion2 Int16, + SilverlightVersion3 Int32, + SilverlightVersion4 Int16, + PageCharset Utf8, + CodeVersion Int32, + IsLink Int16, + IsDownload Int16, + IsNotBounce Int16, + FUniqID Int64, + OriginalURL Utf8, + HID Int32, + IsOldCounter Int16, + IsEvent Int16, + IsParameter Int16, + DontCountHits Int16, + WithHash Int16, + HitColor Utf8, + LocalEventTime Timestamp64, + Age Int16, + Sex Int16, + Income Int16, + Interests Int16, + Robotness Int16, + RemoteIP Int32, + WindowName Int32, + OpenerName Int32, + HistoryLength Int16, + BrowserLanguage Utf8, + BrowserCountry Utf8, + SocialNetwork Utf8, + SocialAction Utf8, + HTTPError Int16, + SendTiming Int32, + DNSTiming Int32, + ConnectTiming Int32, + ResponseStartTiming Int32, + ResponseEndTiming Int32, + FetchTiming Int32, + SocialSourceNetworkID Int16, + SocialSourcePage Utf8, + ParamPrice Int64, + ParamOrderID Utf8, + ParamCurrency Utf8, + ParamCurrencyID Int16, + OpenstatServiceName Utf8, + OpenstatCampaignID Utf8, + OpenstatAdID Utf8, + OpenstatSourceID Utf8, + UTMSource Utf8, + UTMMedium Utf8, + UTMCampaign Utf8, + UTMContent Utf8, + UTMTerm Utf8, + FromTag Utf8, + HasGCLID Int16, + RefererHash Int64, + URLHash Int64, + CLID Int32, + PRIMARY KEY (CounterID, EventDate, UserID, EventTime, WatchID) ) --- (CounterID, EventDate, UserID, EventTime, WatchID) WITH ( --- AUTO_PARTITIONING_BY_SIZE = "ENABLED", - -- "/hits" AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 128 ); diff --git a/ydb/tests/functional/tpc/canondata/test_init.TestClickbenchInit.test_s1_s3/s1_s3 b/ydb/tests/functional/tpc/canondata/test_init.TestClickbenchInit.test_s1_s3/s1_s3 index 8c1a70956bc2..99c72f29341f 100644 --- a/ydb/tests/functional/tpc/canondata/test_init.TestClickbenchInit.test_s1_s3/s1_s3 +++ b/ydb/tests/functional/tpc/canondata/test_init.TestClickbenchInit.test_s1_s3/s1_s3 @@ -1,15 +1,12 @@ Init tables ... --!syntax_v1 +CREATE EXTERNAL DATA SOURCE `/Root/db/Root/db/clickbench/s1_s3_external_source` WITH ( + SOURCE_TYPE="ObjectStorage", + LOCATION="https://storage.yandexcloud.net/tpc", + AUTH_METHOD="NONE" +); - CREATE EXTERNAL DATA SOURCE `/Root/db/Root/db/clickbench/s1_s3_external_source` WITH ( - SOURCE_TYPE="ObjectStorage", - LOCATION="https://storage.yandexcloud.net/tpc", - AUTH_METHOD="NONE" - ); - - -CREATE EXTERNAL TABLE `/Root/db/Root/db/clickbench/s1` -( +CREATE EXTERNAL TABLE `/Root/db/Root/db/clickbench/s1` ( WatchID Int64 NOT NULL, JavaEnable Int16 NOT NULL, Title Utf8 NOT NULL, @@ -115,13 +112,9 @@ CREATE EXTERNAL TABLE `/Root/db/Root/db/clickbench/s1` RefererHash Int64 NOT NULL, URLHash Int64 NOT NULL, CLID Int32 NOT NULL - --(CounterID, EventDate, UserID, EventTime, WatchID) ) --- (CounterID, EventDate, UserID, EventTime, WatchID) WITH ( --- AUTO_PARTITIONING_BY_SIZE = "ENABLED", - DATA_SOURCE = "/Root/db/Root/db/clickbench/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/hits" - -- = 128 + DATA_SOURCE = "/Root/db/Root/db/clickbench/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/s1" ); Init tables ...Ok diff --git a/ydb/tests/functional/tpc/canondata/test_init.TestTpcdsInit.test_s1_column/s1_column b/ydb/tests/functional/tpc/canondata/test_init.TestTpcdsInit.test_s1_column/s1_column index f19208eba0e3..158ec1509f1e 100644 --- a/ydb/tests/functional/tpc/canondata/test_init.TestTpcdsInit.test_s1_column/s1_column +++ b/ydb/tests/functional/tpc/canondata/test_init.TestTpcdsInit.test_s1_column/s1_column @@ -1,669 +1,645 @@ Init tables ... +--!syntax_v1 - -CREATE TABLE `/Root/db/Root/db/tpcds/s1/customer_address` -( - ca_address_sk Int64 NOT NULL, - ca_address_id Utf8, - ca_street_number Utf8, - ca_street_name Utf8, - ca_street_type Utf8, - ca_suite_number Utf8, - ca_city Utf8, - ca_county Utf8, - ca_state Utf8, - ca_zip Utf8, - ca_country Utf8, - ca_gmt_offset Double , - ca_location_type Utf8 - , PRIMARY KEY (ca_address_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/customer_address` ( + ca_address_sk Int64 NOT NULL, + ca_address_id Utf8, + ca_street_number Utf8, + ca_street_name Utf8, + ca_street_type Utf8, + ca_suite_number Utf8, + ca_city Utf8, + ca_county Utf8, + ca_state Utf8, + ca_zip Utf8, + ca_country Utf8, + ca_gmt_offset Double, + ca_location_type Utf8, + PRIMARY KEY (ca_address_sk) ) -PARTITION BY HASH(ca_address_sk) +PARTITION BY HASH (ca_address_sk) WITH ( -STORE = COLUMN, --"/customer_address/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/customer_demographics` -( - cd_demo_sk Int64 NOT NULL, - cd_gender Utf8, - cd_marital_status Utf8, - cd_education_status Utf8, - cd_purchase_estimate Int64 , - cd_credit_rating Utf8, - cd_dep_count Int64 , - cd_dep_employed_count Int64 , - cd_dep_college_count Int64 - , PRIMARY KEY (cd_demo_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/customer_demographics` ( + cd_demo_sk Int64 NOT NULL, + cd_gender Utf8, + cd_marital_status Utf8, + cd_education_status Utf8, + cd_purchase_estimate Int64, + cd_credit_rating Utf8, + cd_dep_count Int64, + cd_dep_employed_count Int64, + cd_dep_college_count Int64, + PRIMARY KEY (cd_demo_sk) ) -PARTITION BY HASH(cd_demo_sk) +PARTITION BY HASH (cd_demo_sk) WITH ( -STORE = COLUMN, --"/customer_demographics/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/date_dim` -( - d_date_sk Int64 NOT NULL, - d_date_id Utf8, - d_date Utf8, - d_month_seq Int64 , - d_week_seq Int64 , - d_quarter_seq Int64 , - d_year Int64 , - d_dow Int64 , - d_moy Int64 , - d_dom Int64 , - d_qoy Int64 , - d_fy_year Int64 , - d_fy_quarter_seq Int64 , - d_fy_week_seq Int64 , - d_day_name Utf8, - d_quarter_name Utf8, - d_holiday Utf8, - d_weekend Utf8, - d_following_holiday Utf8, - d_first_dom Int64 , - d_last_dom Int64 , - d_same_day_ly Int64 , - d_same_day_lq Int64 , - d_current_day Utf8, - d_current_week Utf8, - d_current_month Utf8, - d_current_quarter Utf8, - d_current_year Utf8 - , PRIMARY KEY (d_date_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/date_dim` ( + d_date_sk Int64 NOT NULL, + d_date_id Utf8, + d_date Utf8, + d_month_seq Int64, + d_week_seq Int64, + d_quarter_seq Int64, + d_year Int64, + d_dow Int64, + d_moy Int64, + d_dom Int64, + d_qoy Int64, + d_fy_year Int64, + d_fy_quarter_seq Int64, + d_fy_week_seq Int64, + d_day_name Utf8, + d_quarter_name Utf8, + d_holiday Utf8, + d_weekend Utf8, + d_following_holiday Utf8, + d_first_dom Int64, + d_last_dom Int64, + d_same_day_ly Int64, + d_same_day_lq Int64, + d_current_day Utf8, + d_current_week Utf8, + d_current_month Utf8, + d_current_quarter Utf8, + d_current_year Utf8, + PRIMARY KEY (d_date_sk) ) -PARTITION BY HASH(d_date_sk) +PARTITION BY HASH (d_date_sk) WITH ( -STORE = COLUMN, --"/date_dim/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/warehouse` -( - w_warehouse_sk Int64 NOT NULL, - w_warehouse_id Utf8, - w_warehouse_name Utf8, - w_warehouse_sq_ft Int64 , - w_street_number Utf8, - w_street_name Utf8, - w_street_type Utf8, - w_suite_number Utf8, - w_city Utf8, - w_county Utf8, - w_state Utf8, - w_zip Utf8, - w_country Utf8, - w_gmt_offset Double - , PRIMARY KEY (w_warehouse_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/warehouse` ( + w_warehouse_sk Int64 NOT NULL, + w_warehouse_id Utf8, + w_warehouse_name Utf8, + w_warehouse_sq_ft Int64, + w_street_number Utf8, + w_street_name Utf8, + w_street_type Utf8, + w_suite_number Utf8, + w_city Utf8, + w_county Utf8, + w_state Utf8, + w_zip Utf8, + w_country Utf8, + w_gmt_offset Double, + PRIMARY KEY (w_warehouse_sk) ) -PARTITION BY HASH(w_warehouse_sk) +PARTITION BY HASH (w_warehouse_sk) WITH ( -STORE = COLUMN, --"/warehouse/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/ship_mode` -( - sm_ship_mode_sk Int64 NOT NULL, - sm_ship_mode_id Utf8, - sm_type Utf8, - sm_code Utf8, - sm_carrier Utf8, - sm_contract Utf8 - , PRIMARY KEY (sm_ship_mode_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/ship_mode` ( + sm_ship_mode_sk Int64 NOT NULL, + sm_ship_mode_id Utf8, + sm_type Utf8, + sm_code Utf8, + sm_carrier Utf8, + sm_contract Utf8, + PRIMARY KEY (sm_ship_mode_sk) ) -PARTITION BY HASH(sm_ship_mode_sk) +PARTITION BY HASH (sm_ship_mode_sk) WITH ( -STORE = COLUMN, --"/ship_mode/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/time_dim` -( - t_time_sk Int64 NOT NULL, - t_time_id Utf8, - t_time Int64 , - t_hour Int64 , - t_minute Int64 , - t_second Int64 , - t_am_pm Utf8, - t_shift Utf8, - t_sub_shift Utf8, - t_meal_time Utf8 - , PRIMARY KEY (t_time_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/time_dim` ( + t_time_sk Int64 NOT NULL, + t_time_id Utf8, + t_time Int64, + t_hour Int64, + t_minute Int64, + t_second Int64, + t_am_pm Utf8, + t_shift Utf8, + t_sub_shift Utf8, + t_meal_time Utf8, + PRIMARY KEY (t_time_sk) ) -PARTITION BY HASH(t_time_sk) +PARTITION BY HASH (t_time_sk) WITH ( -STORE = COLUMN, --"/time_dim/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/reason` -( - r_reason_sk Int64 NOT NULL, - r_reason_id Utf8, - r_reason_desc Utf8 - , PRIMARY KEY (r_reason_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/reason` ( + r_reason_sk Int64 NOT NULL, + r_reason_id Utf8, + r_reason_desc Utf8, + PRIMARY KEY (r_reason_sk) ) -PARTITION BY HASH(r_reason_sk) +PARTITION BY HASH (r_reason_sk) WITH ( -STORE = COLUMN, --"/reason/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/income_band` -( - ib_income_band_sk Int64 NOT NULL, - ib_lower_bound Int64 , - ib_upper_bound Int64 - , PRIMARY KEY (ib_income_band_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/income_band` ( + ib_income_band_sk Int64 NOT NULL, + ib_lower_bound Int64, + ib_upper_bound Int64, + PRIMARY KEY (ib_income_band_sk) ) -PARTITION BY HASH(ib_income_band_sk) +PARTITION BY HASH (ib_income_band_sk) WITH ( -STORE = COLUMN, --"/income_band/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/item` -( - i_item_sk Int64 NOT NULL, - i_item_id Utf8, - i_rec_start_date Date32 , - i_rec_end_date Date32 , - i_item_desc Utf8, - i_current_price Double, - i_wholesale_cost Double, - i_brand_id Int64 , - i_brand Utf8, - i_class_id Int64 , - i_class Utf8, - i_category_id Int64 , - i_category Utf8, - i_manufact_id Int64 , - i_manufact Utf8, - i_size Utf8, - i_formulation Utf8, - i_color Utf8, - i_units Utf8, - i_container Utf8, - i_manager_id Int64 , - i_product_name Utf8 - , PRIMARY KEY (i_item_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/item` ( + i_item_sk Int64 NOT NULL, + i_item_id Utf8, + i_rec_start_date Date32, + i_rec_end_date Date32, + i_item_desc Utf8, + i_current_price Double, + i_wholesale_cost Double, + i_brand_id Int64, + i_brand Utf8, + i_class_id Int64, + i_class Utf8, + i_category_id Int64, + i_category Utf8, + i_manufact_id Int64, + i_manufact Utf8, + i_size Utf8, + i_formulation Utf8, + i_color Utf8, + i_units Utf8, + i_container Utf8, + i_manager_id Int64, + i_product_name Utf8, + PRIMARY KEY (i_item_sk) ) -PARTITION BY HASH(i_item_sk) +PARTITION BY HASH (i_item_sk) WITH ( -STORE = COLUMN, --"/item/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/store` -( - s_store_sk Int64 NOT NULL, - s_store_id Utf8, - s_rec_start_date Date32 , - s_rec_end_date Date32 , - s_closed_date_sk Int64 , - s_store_name Utf8, - s_number_employees Int64 , - s_floor_space Int64 , - s_hours Utf8, - s_manager Utf8, - s_market_id Int64 , - s_geography_class Utf8, - s_market_desc Utf8, - s_market_manager Utf8, - s_division_id Int64 , - s_division_name Utf8, - s_company_id Int64 , - s_company_name Utf8, - s_street_number Utf8, - s_street_name Utf8, - s_street_type Utf8, - s_suite_number Utf8, - s_city Utf8, - s_county Utf8, - s_state Utf8, - s_zip Utf8, - s_country Utf8, - s_gmt_offset Double, - s_tax_precentage Double - , PRIMARY KEY (s_store_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/store` ( + s_store_sk Int64 NOT NULL, + s_store_id Utf8, + s_rec_start_date Date32, + s_rec_end_date Date32, + s_closed_date_sk Int64, + s_store_name Utf8, + s_number_employees Int64, + s_floor_space Int64, + s_hours Utf8, + s_manager Utf8, + s_market_id Int64, + s_geography_class Utf8, + s_market_desc Utf8, + s_market_manager Utf8, + s_division_id Int64, + s_division_name Utf8, + s_company_id Int64, + s_company_name Utf8, + s_street_number Utf8, + s_street_name Utf8, + s_street_type Utf8, + s_suite_number Utf8, + s_city Utf8, + s_county Utf8, + s_state Utf8, + s_zip Utf8, + s_country Utf8, + s_gmt_offset Double, + s_tax_precentage Double, + PRIMARY KEY (s_store_sk) ) -PARTITION BY HASH(s_store_sk) +PARTITION BY HASH (s_store_sk) WITH ( -STORE = COLUMN, --"/store/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/call_center` -( - cc_call_center_sk Int64 NOT NULL, - cc_call_center_id Utf8, - cc_rec_start_date Date32 , - cc_rec_end_date Date32 , - cc_closed_date_sk Int64 , - cc_open_date_sk Int64 , - cc_name Utf8, - cc_class Utf8, - cc_employees Int64 , - cc_sq_ft Int64 , - cc_hours Utf8, - cc_manager Utf8, - cc_mkt_id Int64 , - cc_mkt_class Utf8, - cc_mkt_desc Utf8, - cc_market_manager Utf8, - cc_division Int64 , - cc_division_name Utf8, - cc_company Int64 , - cc_company_name Utf8, - cc_street_number Utf8, - cc_street_name Utf8, - cc_street_type Utf8, - cc_suite_number Utf8, - cc_city Utf8, - cc_county Utf8, - cc_state Utf8, - cc_zip Utf8, - cc_country Utf8, - cc_gmt_offset Double, - cc_tax_percentage Double - , PRIMARY KEY (cc_call_center_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/call_center` ( + cc_call_center_sk Int64 NOT NULL, + cc_call_center_id Utf8, + cc_rec_start_date Date32, + cc_rec_end_date Date32, + cc_closed_date_sk Int64, + cc_open_date_sk Int64, + cc_name Utf8, + cc_class Utf8, + cc_employees Int64, + cc_sq_ft Int64, + cc_hours Utf8, + cc_manager Utf8, + cc_mkt_id Int64, + cc_mkt_class Utf8, + cc_mkt_desc Utf8, + cc_market_manager Utf8, + cc_division Int64, + cc_division_name Utf8, + cc_company Int64, + cc_company_name Utf8, + cc_street_number Utf8, + cc_street_name Utf8, + cc_street_type Utf8, + cc_suite_number Utf8, + cc_city Utf8, + cc_county Utf8, + cc_state Utf8, + cc_zip Utf8, + cc_country Utf8, + cc_gmt_offset Double, + cc_tax_percentage Double, + PRIMARY KEY (cc_call_center_sk) ) -PARTITION BY HASH(cc_call_center_sk) +PARTITION BY HASH (cc_call_center_sk) WITH ( -STORE = COLUMN, --"/call_center/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/customer` -( - c_customer_sk Int64 NOT NULL, - c_customer_id Utf8, - c_current_cdemo_sk Int64 , - c_current_hdemo_sk Int64 , - c_current_addr_sk Int64 , - c_first_shipto_date_sk Int64 , - c_first_sales_date_sk Int64 , - c_salutation Utf8, - c_first_name Utf8, - c_last_name Utf8, - c_preferred_cust_flag Utf8, - c_birth_day Int64 , - c_birth_month Int64 , - c_birth_year Int64 , - c_birth_country Utf8, - c_login Utf8, - c_email_address Utf8, - c_last_review_date Utf8 - , PRIMARY KEY (c_customer_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/customer` ( + c_customer_sk Int64 NOT NULL, + c_customer_id Utf8, + c_current_cdemo_sk Int64, + c_current_hdemo_sk Int64, + c_current_addr_sk Int64, + c_first_shipto_date_sk Int64, + c_first_sales_date_sk Int64, + c_salutation Utf8, + c_first_name Utf8, + c_last_name Utf8, + c_preferred_cust_flag Utf8, + c_birth_day Int64, + c_birth_month Int64, + c_birth_year Int64, + c_birth_country Utf8, + c_login Utf8, + c_email_address Utf8, + c_last_review_date Utf8, + PRIMARY KEY (c_customer_sk) ) -PARTITION BY HASH(c_customer_sk) +PARTITION BY HASH (c_customer_sk) WITH ( -STORE = COLUMN, --"/customer/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/web_site` -( - web_site_sk Int64 NOT NULL, - web_site_id Utf8, - web_rec_start_date Date32 , - web_rec_end_date Date32 , - web_name Utf8, - web_open_date_sk Int64 , - web_close_date_sk Int64 , - web_class Utf8, - web_manager Utf8, - web_mkt_id Int64 , - web_mkt_class Utf8, - web_mkt_desc Utf8, - web_market_manager Utf8, - web_company_id Int64 , - web_company_name Utf8, - web_street_number Utf8, - web_street_name Utf8, - web_street_type Utf8, - web_suite_number Utf8, - web_city Utf8, - web_county Utf8, - web_state Utf8, - web_zip Utf8, - web_country Utf8, - web_gmt_offset Double, - web_tax_percentage Double - , PRIMARY KEY (web_site_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/web_site` ( + web_site_sk Int64 NOT NULL, + web_site_id Utf8, + web_rec_start_date Date32, + web_rec_end_date Date32, + web_name Utf8, + web_open_date_sk Int64, + web_close_date_sk Int64, + web_class Utf8, + web_manager Utf8, + web_mkt_id Int64, + web_mkt_class Utf8, + web_mkt_desc Utf8, + web_market_manager Utf8, + web_company_id Int64, + web_company_name Utf8, + web_street_number Utf8, + web_street_name Utf8, + web_street_type Utf8, + web_suite_number Utf8, + web_city Utf8, + web_county Utf8, + web_state Utf8, + web_zip Utf8, + web_country Utf8, + web_gmt_offset Double, + web_tax_percentage Double, + PRIMARY KEY (web_site_sk) ) -PARTITION BY HASH(web_site_sk) +PARTITION BY HASH (web_site_sk) WITH ( -STORE = COLUMN, --"/web_site/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/store_returns` -( - sr_returned_date_sk Int64 , - sr_return_time_sk Int64 , - sr_item_sk Int64 NOT NULL, - sr_customer_sk Int64 , - sr_cdemo_sk Int64 , - sr_hdemo_sk Int64 , - sr_addr_sk Int64 , - sr_store_sk Int64 , - sr_reason_sk Int64 , - sr_ticket_number Int64 NOT NULL, - sr_return_quantity Int64 , - sr_return_amt Double, - sr_return_tax Double, - sr_return_amt_inc_tax Double, - sr_fee Double, - sr_return_ship_cost Double, - sr_refunded_cash Double, - sr_reversed_charge Double, - sr_store_credit Double, - sr_net_loss Double - , PRIMARY KEY (sr_item_sk, sr_ticket_number) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/store_returns` ( + sr_returned_date_sk Int64, + sr_return_time_sk Int64, + sr_item_sk Int64 NOT NULL, + sr_customer_sk Int64, + sr_cdemo_sk Int64, + sr_hdemo_sk Int64, + sr_addr_sk Int64, + sr_store_sk Int64, + sr_reason_sk Int64, + sr_ticket_number Int64 NOT NULL, + sr_return_quantity Int64, + sr_return_amt Double, + sr_return_tax Double, + sr_return_amt_inc_tax Double, + sr_fee Double, + sr_return_ship_cost Double, + sr_refunded_cash Double, + sr_reversed_charge Double, + sr_store_credit Double, + sr_net_loss Double, + PRIMARY KEY (sr_item_sk, sr_ticket_number) ) -PARTITION BY HASH(sr_item_sk, sr_ticket_number) +PARTITION BY HASH (sr_item_sk, sr_ticket_number) WITH ( -STORE = COLUMN, --"/store_returns/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/household_demographics` -( - hd_demo_sk Int64 NOT NULL, - hd_income_band_sk Int64 , - hd_buy_potential Utf8, - hd_dep_count Int64 , - hd_vehicle_count Int64 - , PRIMARY KEY (hd_demo_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/household_demographics` ( + hd_demo_sk Int64 NOT NULL, + hd_income_band_sk Int64, + hd_buy_potential Utf8, + hd_dep_count Int64, + hd_vehicle_count Int64, + PRIMARY KEY (hd_demo_sk) ) -PARTITION BY HASH(hd_demo_sk) +PARTITION BY HASH (hd_demo_sk) WITH ( -STORE = COLUMN, --"/household_demographics/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/web_page` -( - wp_web_page_sk Int64 NOT NULL, - wp_web_page_id Utf8, - wp_rec_start_date Date32 , - wp_rec_end_date Date32 , - wp_creation_date_sk Int64 , - wp_access_date_sk Int64 , - wp_autogen_flag Utf8, - wp_customer_sk Int64 , - wp_url Utf8, - wp_type Utf8, - wp_char_count Int64 , - wp_link_count Int64 , - wp_image_count Int64 , - wp_max_ad_count Int64 - , PRIMARY KEY (wp_web_page_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/web_page` ( + wp_web_page_sk Int64 NOT NULL, + wp_web_page_id Utf8, + wp_rec_start_date Date32, + wp_rec_end_date Date32, + wp_creation_date_sk Int64, + wp_access_date_sk Int64, + wp_autogen_flag Utf8, + wp_customer_sk Int64, + wp_url Utf8, + wp_type Utf8, + wp_char_count Int64, + wp_link_count Int64, + wp_image_count Int64, + wp_max_ad_count Int64, + PRIMARY KEY (wp_web_page_sk) ) -PARTITION BY HASH(wp_web_page_sk) +PARTITION BY HASH (wp_web_page_sk) WITH ( -STORE = COLUMN, --"/web_page/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/promotion` -( - p_promo_sk Int64 NOT NULL, - p_promo_id Utf8, - p_start_date_sk Int64 , - p_end_date_sk Int64 , - p_item_sk Int64 , - p_cost Double, - p_response_target Int64 , - p_promo_name Utf8, - p_channel_dmail Utf8, - p_channel_email Utf8, - p_channel_catalog Utf8, - p_channel_tv Utf8, - p_channel_radio Utf8, - p_channel_press Utf8, - p_channel_event Utf8, - p_channel_demo Utf8, - p_channel_details Utf8, - p_purpose Utf8, - p_discount_active Utf8 - , PRIMARY KEY (p_promo_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/promotion` ( + p_promo_sk Int64 NOT NULL, + p_promo_id Utf8, + p_start_date_sk Int64, + p_end_date_sk Int64, + p_item_sk Int64, + p_cost Double, + p_response_target Int64, + p_promo_name Utf8, + p_channel_dmail Utf8, + p_channel_email Utf8, + p_channel_catalog Utf8, + p_channel_tv Utf8, + p_channel_radio Utf8, + p_channel_press Utf8, + p_channel_event Utf8, + p_channel_demo Utf8, + p_channel_details Utf8, + p_purpose Utf8, + p_discount_active Utf8, + PRIMARY KEY (p_promo_sk) ) -PARTITION BY HASH(p_promo_sk) +PARTITION BY HASH (p_promo_sk) WITH ( -STORE = COLUMN, --"/promotion/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/catalog_page` -( - cp_catalog_page_sk Int64 NOT NULL, - cp_catalog_page_id Utf8, - cp_start_date_sk Int64 , - cp_end_date_sk Int64 , - cp_department Utf8, - cp_catalog_number Int64 , - cp_catalog_page_number Int64 , - cp_description Utf8, - cp_type Utf8 - , PRIMARY KEY (cp_catalog_page_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/catalog_page` ( + cp_catalog_page_sk Int64 NOT NULL, + cp_catalog_page_id Utf8, + cp_start_date_sk Int64, + cp_end_date_sk Int64, + cp_department Utf8, + cp_catalog_number Int64, + cp_catalog_page_number Int64, + cp_description Utf8, + cp_type Utf8, + PRIMARY KEY (cp_catalog_page_sk) ) -PARTITION BY HASH(cp_catalog_page_sk) +PARTITION BY HASH (cp_catalog_page_sk) WITH ( -STORE = COLUMN, --"/catalog_page/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/inventory` -( - inv_date_sk Int64 NOT NULL, - inv_item_sk Int64 NOT NULL, - inv_warehouse_sk Int64 NOT NULL, - inv_quantity_on_hand Int64 - , PRIMARY KEY (inv_date_sk, inv_item_sk, inv_warehouse_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/inventory` ( + inv_date_sk Int64 NOT NULL, + inv_item_sk Int64 NOT NULL, + inv_warehouse_sk Int64 NOT NULL, + inv_quantity_on_hand Int64, + PRIMARY KEY (inv_date_sk, inv_item_sk, inv_warehouse_sk) ) -PARTITION BY HASH(inv_date_sk, inv_item_sk, inv_warehouse_sk) +PARTITION BY HASH (inv_date_sk, inv_item_sk, inv_warehouse_sk) WITH ( -STORE = COLUMN, --"/inventory/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/catalog_returns` -( - cr_returned_date_sk Int64 , - cr_returned_time_sk Int64 , - cr_item_sk Int64 NOT NULL, - cr_refunded_customer_sk Int64 , - cr_refunded_cdemo_sk Int64 , - cr_refunded_hdemo_sk Int64 , - cr_refunded_addr_sk Int64 , - cr_returning_customer_sk Int64 , - cr_returning_cdemo_sk Int64 , - cr_returning_hdemo_sk Int64 , - cr_returning_addr_sk Int64 , - cr_call_center_sk Int64 , - cr_catalog_page_sk Int64 , - cr_ship_mode_sk Int64 , - cr_warehouse_sk Int64 , - cr_reason_sk Int64 , - cr_order_number Int64 NOT NULL, - cr_return_quantity Int64 , - cr_return_amount Double, - cr_return_tax Double, - cr_return_amt_inc_tax Double, - cr_fee Double, - cr_return_ship_cost Double, - cr_refunded_cash Double, - cr_reversed_charge Double, - cr_store_credit Double, - cr_net_loss Double - , PRIMARY KEY (cr_item_sk, cr_order_number) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/catalog_returns` ( + cr_returned_date_sk Int64, + cr_returned_time_sk Int64, + cr_item_sk Int64 NOT NULL, + cr_refunded_customer_sk Int64, + cr_refunded_cdemo_sk Int64, + cr_refunded_hdemo_sk Int64, + cr_refunded_addr_sk Int64, + cr_returning_customer_sk Int64, + cr_returning_cdemo_sk Int64, + cr_returning_hdemo_sk Int64, + cr_returning_addr_sk Int64, + cr_call_center_sk Int64, + cr_catalog_page_sk Int64, + cr_ship_mode_sk Int64, + cr_warehouse_sk Int64, + cr_reason_sk Int64, + cr_order_number Int64 NOT NULL, + cr_return_quantity Int64, + cr_return_amount Double, + cr_return_tax Double, + cr_return_amt_inc_tax Double, + cr_fee Double, + cr_return_ship_cost Double, + cr_refunded_cash Double, + cr_reversed_charge Double, + cr_store_credit Double, + cr_net_loss Double, + PRIMARY KEY (cr_item_sk, cr_order_number) ) -PARTITION BY HASH(cr_item_sk, cr_order_number) +PARTITION BY HASH (cr_item_sk, cr_order_number) WITH ( -STORE = COLUMN, --"/catalog_returns/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/web_returns` -( - wr_returned_date_sk Int64 , - wr_returned_time_sk Int64 , - wr_item_sk Int64 NOT NULL, - wr_refunded_customer_sk Int64 , - wr_refunded_cdemo_sk Int64 , - wr_refunded_hdemo_sk Int64 , - wr_refunded_addr_sk Int64 , - wr_returning_customer_sk Int64 , - wr_returning_cdemo_sk Int64 , - wr_returning_hdemo_sk Int64 , - wr_returning_addr_sk Int64 , - wr_web_page_sk Int64 , - wr_reason_sk Int64 , - wr_order_number Int64 NOT NULL, - wr_return_quantity Int64 , - wr_return_amt Double, - wr_return_tax Double, - wr_return_amt_inc_tax Double, - wr_fee Double, - wr_return_ship_cost Double, - wr_refunded_cash Double, - wr_reversed_charge Double, - wr_account_credit Double, - wr_net_loss Double - , PRIMARY KEY (wr_item_sk, wr_order_number) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/web_returns` ( + wr_returned_date_sk Int64, + wr_returned_time_sk Int64, + wr_item_sk Int64 NOT NULL, + wr_refunded_customer_sk Int64, + wr_refunded_cdemo_sk Int64, + wr_refunded_hdemo_sk Int64, + wr_refunded_addr_sk Int64, + wr_returning_customer_sk Int64, + wr_returning_cdemo_sk Int64, + wr_returning_hdemo_sk Int64, + wr_returning_addr_sk Int64, + wr_web_page_sk Int64, + wr_reason_sk Int64, + wr_order_number Int64 NOT NULL, + wr_return_quantity Int64, + wr_return_amt Double, + wr_return_tax Double, + wr_return_amt_inc_tax Double, + wr_fee Double, + wr_return_ship_cost Double, + wr_refunded_cash Double, + wr_reversed_charge Double, + wr_account_credit Double, + wr_net_loss Double, + PRIMARY KEY (wr_item_sk, wr_order_number) ) -PARTITION BY HASH(wr_item_sk, wr_order_number) +PARTITION BY HASH (wr_item_sk, wr_order_number) WITH ( -STORE = COLUMN, --"/web_returns/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/web_sales` -( - ws_sold_date_sk Int64 , - ws_sold_time_sk Int64 , - ws_ship_date_sk Int64 , - ws_item_sk Int64 NOT NULL, - ws_bill_customer_sk Int64 , - ws_bill_cdemo_sk Int64 , - ws_bill_hdemo_sk Int64 , - ws_bill_addr_sk Int64 , - ws_ship_customer_sk Int64 , - ws_ship_cdemo_sk Int64 , - ws_ship_hdemo_sk Int64 , - ws_ship_addr_sk Int64 , - ws_web_page_sk Int64 , - ws_web_site_sk Int64 , - ws_ship_mode_sk Int64 , - ws_warehouse_sk Int64 , - ws_promo_sk Int64 , - ws_order_number Int64 NOT NULL, - ws_quantity Int64 , - ws_wholesale_cost Double, - ws_list_price Double, - ws_sales_price Double, - ws_ext_discount_amt Double, - ws_ext_sales_price Double, - ws_ext_wholesale_cost Double, - ws_ext_list_price Double, - ws_ext_tax Double, - ws_coupon_amt Double, - ws_ext_ship_cost Double, - ws_net_paid Double, - ws_net_paid_inc_tax Double, - ws_net_paid_inc_ship Double, - ws_net_paid_inc_ship_tax Double, - ws_net_profit Double - , PRIMARY KEY (ws_item_sk, ws_order_number) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/web_sales` ( + ws_sold_date_sk Int64, + ws_sold_time_sk Int64, + ws_ship_date_sk Int64, + ws_item_sk Int64 NOT NULL, + ws_bill_customer_sk Int64, + ws_bill_cdemo_sk Int64, + ws_bill_hdemo_sk Int64, + ws_bill_addr_sk Int64, + ws_ship_customer_sk Int64, + ws_ship_cdemo_sk Int64, + ws_ship_hdemo_sk Int64, + ws_ship_addr_sk Int64, + ws_web_page_sk Int64, + ws_web_site_sk Int64, + ws_ship_mode_sk Int64, + ws_warehouse_sk Int64, + ws_promo_sk Int64, + ws_order_number Int64 NOT NULL, + ws_quantity Int64, + ws_wholesale_cost Double, + ws_list_price Double, + ws_sales_price Double, + ws_ext_discount_amt Double, + ws_ext_sales_price Double, + ws_ext_wholesale_cost Double, + ws_ext_list_price Double, + ws_ext_tax Double, + ws_coupon_amt Double, + ws_ext_ship_cost Double, + ws_net_paid Double, + ws_net_paid_inc_tax Double, + ws_net_paid_inc_ship Double, + ws_net_paid_inc_ship_tax Double, + ws_net_profit Double, + PRIMARY KEY (ws_item_sk, ws_order_number) ) -PARTITION BY HASH(ws_item_sk, ws_order_number) +PARTITION BY HASH (ws_item_sk, ws_order_number) WITH ( -STORE = COLUMN, --"/web_sales/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/catalog_sales` -( - cs_sold_date_sk Int64 , - cs_sold_time_sk Int64 , - cs_ship_date_sk Int64 , - cs_bill_customer_sk Int64 , - cs_bill_cdemo_sk Int64 , - cs_bill_hdemo_sk Int64 , - cs_bill_addr_sk Int64 , - cs_ship_customer_sk Int64 , - cs_ship_cdemo_sk Int64 , - cs_ship_hdemo_sk Int64 , - cs_ship_addr_sk Int64 , - cs_call_center_sk Int64 , - cs_catalog_page_sk Int64 , - cs_ship_mode_sk Int64 , - cs_warehouse_sk Int64 , - cs_item_sk Int64 NOT NULL, - cs_promo_sk Int64 , - cs_order_number Int64 NOT NULL, - cs_quantity Int64 , - cs_wholesale_cost Double, - cs_list_price Double, - cs_sales_price Double, - cs_ext_discount_amt Double, - cs_ext_sales_price Double, - cs_ext_wholesale_cost Double, - cs_ext_list_price Double, - cs_ext_tax Double, - cs_coupon_amt Double, - cs_ext_ship_cost Double, - cs_net_paid Double, - cs_net_paid_inc_tax Double, - cs_net_paid_inc_ship Double, - cs_net_paid_inc_ship_tax Double, - cs_net_profit Double - , PRIMARY KEY (cs_item_sk, cs_order_number) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/catalog_sales` ( + cs_sold_date_sk Int64, + cs_sold_time_sk Int64, + cs_ship_date_sk Int64, + cs_bill_customer_sk Int64, + cs_bill_cdemo_sk Int64, + cs_bill_hdemo_sk Int64, + cs_bill_addr_sk Int64, + cs_ship_customer_sk Int64, + cs_ship_cdemo_sk Int64, + cs_ship_hdemo_sk Int64, + cs_ship_addr_sk Int64, + cs_call_center_sk Int64, + cs_catalog_page_sk Int64, + cs_ship_mode_sk Int64, + cs_warehouse_sk Int64, + cs_item_sk Int64 NOT NULL, + cs_promo_sk Int64, + cs_order_number Int64 NOT NULL, + cs_quantity Int64, + cs_wholesale_cost Double, + cs_list_price Double, + cs_sales_price Double, + cs_ext_discount_amt Double, + cs_ext_sales_price Double, + cs_ext_wholesale_cost Double, + cs_ext_list_price Double, + cs_ext_tax Double, + cs_coupon_amt Double, + cs_ext_ship_cost Double, + cs_net_paid Double, + cs_net_paid_inc_tax Double, + cs_net_paid_inc_ship Double, + cs_net_paid_inc_ship_tax Double, + cs_net_profit Double, + PRIMARY KEY (cs_item_sk, cs_order_number) ) -PARTITION BY HASH(cs_item_sk, cs_order_number) +PARTITION BY HASH (cs_item_sk, cs_order_number) WITH ( -STORE = COLUMN, --"/catalog_sales/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/store_sales` -( - ss_sold_date_sk Int64 , - ss_sold_time_sk Int64 , - ss_item_sk Int64 NOT NULL, - ss_customer_sk Int64 , - ss_cdemo_sk Int64 , - ss_hdemo_sk Int64 , - ss_addr_sk Int64 , - ss_store_sk Int64 , - ss_promo_sk Int64 , - ss_ticket_number Int64 NOT NULL, - ss_quantity Int64 , - ss_wholesale_cost Double, - ss_list_price Double, - ss_sales_price Double, - ss_ext_discount_amt Double, - ss_ext_sales_price Double, - ss_ext_wholesale_cost Double, - ss_ext_list_price Double, - ss_ext_tax Double, - ss_coupon_amt Double, - ss_net_paid Double, - ss_net_paid_inc_tax Double, - ss_net_profit Double - , PRIMARY KEY (ss_item_sk, ss_ticket_number) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/store_sales` ( + ss_sold_date_sk Int64, + ss_sold_time_sk Int64, + ss_item_sk Int64 NOT NULL, + ss_customer_sk Int64, + ss_cdemo_sk Int64, + ss_hdemo_sk Int64, + ss_addr_sk Int64, + ss_store_sk Int64, + ss_promo_sk Int64, + ss_ticket_number Int64 NOT NULL, + ss_quantity Int64, + ss_wholesale_cost Double, + ss_list_price Double, + ss_sales_price Double, + ss_ext_discount_amt Double, + ss_ext_sales_price Double, + ss_ext_wholesale_cost Double, + ss_ext_list_price Double, + ss_ext_tax Double, + ss_coupon_amt Double, + ss_net_paid Double, + ss_net_paid_inc_tax Double, + ss_net_profit Double, + PRIMARY KEY (ss_item_sk, ss_ticket_number) ) -PARTITION BY HASH(ss_item_sk, ss_ticket_number) +PARTITION BY HASH (ss_item_sk, ss_ticket_number) WITH ( -STORE = COLUMN, --"/store_sales/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); Init tables ...Ok diff --git a/ydb/tests/functional/tpc/canondata/test_init.TestTpcdsInit.test_s1_column_decimal/s1_column_decimal b/ydb/tests/functional/tpc/canondata/test_init.TestTpcdsInit.test_s1_column_decimal/s1_column_decimal index fa2b5c90d98e..f33f45202f87 100644 --- a/ydb/tests/functional/tpc/canondata/test_init.TestTpcdsInit.test_s1_column_decimal/s1_column_decimal +++ b/ydb/tests/functional/tpc/canondata/test_init.TestTpcdsInit.test_s1_column_decimal/s1_column_decimal @@ -1,669 +1,645 @@ Init tables ... +--!syntax_v1 - -CREATE TABLE `/Root/db/Root/db/tpcds/s1/customer_address` -( - ca_address_sk Int64 NOT NULL, - ca_address_id Utf8, - ca_street_number Utf8, - ca_street_name Utf8, - ca_street_type Utf8, - ca_suite_number Utf8, - ca_city Utf8, - ca_county Utf8, - ca_state Utf8, - ca_zip Utf8, - ca_country Utf8, - ca_gmt_offset Decimal(5,2) , - ca_location_type Utf8 - , PRIMARY KEY (ca_address_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/customer_address` ( + ca_address_sk Int64 NOT NULL, + ca_address_id Utf8, + ca_street_number Utf8, + ca_street_name Utf8, + ca_street_type Utf8, + ca_suite_number Utf8, + ca_city Utf8, + ca_county Utf8, + ca_state Utf8, + ca_zip Utf8, + ca_country Utf8, + ca_gmt_offset Decimal(5,2), + ca_location_type Utf8, + PRIMARY KEY (ca_address_sk) ) -PARTITION BY HASH(ca_address_sk) +PARTITION BY HASH (ca_address_sk) WITH ( -STORE = COLUMN, --"/customer_address/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/customer_demographics` -( - cd_demo_sk Int64 NOT NULL, - cd_gender Utf8, - cd_marital_status Utf8, - cd_education_status Utf8, - cd_purchase_estimate Int64 , - cd_credit_rating Utf8, - cd_dep_count Int64 , - cd_dep_employed_count Int64 , - cd_dep_college_count Int64 - , PRIMARY KEY (cd_demo_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/customer_demographics` ( + cd_demo_sk Int64 NOT NULL, + cd_gender Utf8, + cd_marital_status Utf8, + cd_education_status Utf8, + cd_purchase_estimate Int64, + cd_credit_rating Utf8, + cd_dep_count Int64, + cd_dep_employed_count Int64, + cd_dep_college_count Int64, + PRIMARY KEY (cd_demo_sk) ) -PARTITION BY HASH(cd_demo_sk) +PARTITION BY HASH (cd_demo_sk) WITH ( -STORE = COLUMN, --"/customer_demographics/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/date_dim` -( - d_date_sk Int64 NOT NULL, - d_date_id Utf8, - d_date Utf8, - d_month_seq Int64 , - d_week_seq Int64 , - d_quarter_seq Int64 , - d_year Int64 , - d_dow Int64 , - d_moy Int64 , - d_dom Int64 , - d_qoy Int64 , - d_fy_year Int64 , - d_fy_quarter_seq Int64 , - d_fy_week_seq Int64 , - d_day_name Utf8, - d_quarter_name Utf8, - d_holiday Utf8, - d_weekend Utf8, - d_following_holiday Utf8, - d_first_dom Int64 , - d_last_dom Int64 , - d_same_day_ly Int64 , - d_same_day_lq Int64 , - d_current_day Utf8, - d_current_week Utf8, - d_current_month Utf8, - d_current_quarter Utf8, - d_current_year Utf8 - , PRIMARY KEY (d_date_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/date_dim` ( + d_date_sk Int64 NOT NULL, + d_date_id Utf8, + d_date Utf8, + d_month_seq Int64, + d_week_seq Int64, + d_quarter_seq Int64, + d_year Int64, + d_dow Int64, + d_moy Int64, + d_dom Int64, + d_qoy Int64, + d_fy_year Int64, + d_fy_quarter_seq Int64, + d_fy_week_seq Int64, + d_day_name Utf8, + d_quarter_name Utf8, + d_holiday Utf8, + d_weekend Utf8, + d_following_holiday Utf8, + d_first_dom Int64, + d_last_dom Int64, + d_same_day_ly Int64, + d_same_day_lq Int64, + d_current_day Utf8, + d_current_week Utf8, + d_current_month Utf8, + d_current_quarter Utf8, + d_current_year Utf8, + PRIMARY KEY (d_date_sk) ) -PARTITION BY HASH(d_date_sk) +PARTITION BY HASH (d_date_sk) WITH ( -STORE = COLUMN, --"/date_dim/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/warehouse` -( - w_warehouse_sk Int64 NOT NULL, - w_warehouse_id Utf8, - w_warehouse_name Utf8, - w_warehouse_sq_ft Int64 , - w_street_number Utf8, - w_street_name Utf8, - w_street_type Utf8, - w_suite_number Utf8, - w_city Utf8, - w_county Utf8, - w_state Utf8, - w_zip Utf8, - w_country Utf8, - w_gmt_offset Decimal(5,2) - , PRIMARY KEY (w_warehouse_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/warehouse` ( + w_warehouse_sk Int64 NOT NULL, + w_warehouse_id Utf8, + w_warehouse_name Utf8, + w_warehouse_sq_ft Int64, + w_street_number Utf8, + w_street_name Utf8, + w_street_type Utf8, + w_suite_number Utf8, + w_city Utf8, + w_county Utf8, + w_state Utf8, + w_zip Utf8, + w_country Utf8, + w_gmt_offset Decimal(5,2), + PRIMARY KEY (w_warehouse_sk) ) -PARTITION BY HASH(w_warehouse_sk) +PARTITION BY HASH (w_warehouse_sk) WITH ( -STORE = COLUMN, --"/warehouse/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/ship_mode` -( - sm_ship_mode_sk Int64 NOT NULL, - sm_ship_mode_id Utf8, - sm_type Utf8, - sm_code Utf8, - sm_carrier Utf8, - sm_contract Utf8 - , PRIMARY KEY (sm_ship_mode_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/ship_mode` ( + sm_ship_mode_sk Int64 NOT NULL, + sm_ship_mode_id Utf8, + sm_type Utf8, + sm_code Utf8, + sm_carrier Utf8, + sm_contract Utf8, + PRIMARY KEY (sm_ship_mode_sk) ) -PARTITION BY HASH(sm_ship_mode_sk) +PARTITION BY HASH (sm_ship_mode_sk) WITH ( -STORE = COLUMN, --"/ship_mode/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/time_dim` -( - t_time_sk Int64 NOT NULL, - t_time_id Utf8, - t_time Int64 , - t_hour Int64 , - t_minute Int64 , - t_second Int64 , - t_am_pm Utf8, - t_shift Utf8, - t_sub_shift Utf8, - t_meal_time Utf8 - , PRIMARY KEY (t_time_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/time_dim` ( + t_time_sk Int64 NOT NULL, + t_time_id Utf8, + t_time Int64, + t_hour Int64, + t_minute Int64, + t_second Int64, + t_am_pm Utf8, + t_shift Utf8, + t_sub_shift Utf8, + t_meal_time Utf8, + PRIMARY KEY (t_time_sk) ) -PARTITION BY HASH(t_time_sk) +PARTITION BY HASH (t_time_sk) WITH ( -STORE = COLUMN, --"/time_dim/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/reason` -( - r_reason_sk Int64 NOT NULL, - r_reason_id Utf8, - r_reason_desc Utf8 - , PRIMARY KEY (r_reason_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/reason` ( + r_reason_sk Int64 NOT NULL, + r_reason_id Utf8, + r_reason_desc Utf8, + PRIMARY KEY (r_reason_sk) ) -PARTITION BY HASH(r_reason_sk) +PARTITION BY HASH (r_reason_sk) WITH ( -STORE = COLUMN, --"/reason/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/income_band` -( - ib_income_band_sk Int64 NOT NULL, - ib_lower_bound Int64 , - ib_upper_bound Int64 - , PRIMARY KEY (ib_income_band_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/income_band` ( + ib_income_band_sk Int64 NOT NULL, + ib_lower_bound Int64, + ib_upper_bound Int64, + PRIMARY KEY (ib_income_band_sk) ) -PARTITION BY HASH(ib_income_band_sk) +PARTITION BY HASH (ib_income_band_sk) WITH ( -STORE = COLUMN, --"/income_band/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/item` -( - i_item_sk Int64 NOT NULL, - i_item_id Utf8, - i_rec_start_date Date32 , - i_rec_end_date Date32 , - i_item_desc Utf8, - i_current_price Decimal(7,2), - i_wholesale_cost Decimal(7,2), - i_brand_id Int64 , - i_brand Utf8, - i_class_id Int64 , - i_class Utf8, - i_category_id Int64 , - i_category Utf8, - i_manufact_id Int64 , - i_manufact Utf8, - i_size Utf8, - i_formulation Utf8, - i_color Utf8, - i_units Utf8, - i_container Utf8, - i_manager_id Int64 , - i_product_name Utf8 - , PRIMARY KEY (i_item_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/item` ( + i_item_sk Int64 NOT NULL, + i_item_id Utf8, + i_rec_start_date Date32, + i_rec_end_date Date32, + i_item_desc Utf8, + i_current_price Decimal(7,2), + i_wholesale_cost Decimal(7,2), + i_brand_id Int64, + i_brand Utf8, + i_class_id Int64, + i_class Utf8, + i_category_id Int64, + i_category Utf8, + i_manufact_id Int64, + i_manufact Utf8, + i_size Utf8, + i_formulation Utf8, + i_color Utf8, + i_units Utf8, + i_container Utf8, + i_manager_id Int64, + i_product_name Utf8, + PRIMARY KEY (i_item_sk) ) -PARTITION BY HASH(i_item_sk) +PARTITION BY HASH (i_item_sk) WITH ( -STORE = COLUMN, --"/item/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/store` -( - s_store_sk Int64 NOT NULL, - s_store_id Utf8, - s_rec_start_date Date32 , - s_rec_end_date Date32 , - s_closed_date_sk Int64 , - s_store_name Utf8, - s_number_employees Int64 , - s_floor_space Int64 , - s_hours Utf8, - s_manager Utf8, - s_market_id Int64 , - s_geography_class Utf8, - s_market_desc Utf8, - s_market_manager Utf8, - s_division_id Int64 , - s_division_name Utf8, - s_company_id Int64 , - s_company_name Utf8, - s_street_number Utf8, - s_street_name Utf8, - s_street_type Utf8, - s_suite_number Utf8, - s_city Utf8, - s_county Utf8, - s_state Utf8, - s_zip Utf8, - s_country Utf8, - s_gmt_offset Decimal(5,2), - s_tax_precentage Decimal(5,2) - , PRIMARY KEY (s_store_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/store` ( + s_store_sk Int64 NOT NULL, + s_store_id Utf8, + s_rec_start_date Date32, + s_rec_end_date Date32, + s_closed_date_sk Int64, + s_store_name Utf8, + s_number_employees Int64, + s_floor_space Int64, + s_hours Utf8, + s_manager Utf8, + s_market_id Int64, + s_geography_class Utf8, + s_market_desc Utf8, + s_market_manager Utf8, + s_division_id Int64, + s_division_name Utf8, + s_company_id Int64, + s_company_name Utf8, + s_street_number Utf8, + s_street_name Utf8, + s_street_type Utf8, + s_suite_number Utf8, + s_city Utf8, + s_county Utf8, + s_state Utf8, + s_zip Utf8, + s_country Utf8, + s_gmt_offset Decimal(5,2), + s_tax_precentage Decimal(5,2), + PRIMARY KEY (s_store_sk) ) -PARTITION BY HASH(s_store_sk) +PARTITION BY HASH (s_store_sk) WITH ( -STORE = COLUMN, --"/store/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/call_center` -( - cc_call_center_sk Int64 NOT NULL, - cc_call_center_id Utf8, - cc_rec_start_date Date32 , - cc_rec_end_date Date32 , - cc_closed_date_sk Int64 , - cc_open_date_sk Int64 , - cc_name Utf8, - cc_class Utf8, - cc_employees Int64 , - cc_sq_ft Int64 , - cc_hours Utf8, - cc_manager Utf8, - cc_mkt_id Int64 , - cc_mkt_class Utf8, - cc_mkt_desc Utf8, - cc_market_manager Utf8, - cc_division Int64 , - cc_division_name Utf8, - cc_company Int64 , - cc_company_name Utf8, - cc_street_number Utf8, - cc_street_name Utf8, - cc_street_type Utf8, - cc_suite_number Utf8, - cc_city Utf8, - cc_county Utf8, - cc_state Utf8, - cc_zip Utf8, - cc_country Utf8, - cc_gmt_offset Decimal(5,2), - cc_tax_percentage Decimal(5,2) - , PRIMARY KEY (cc_call_center_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/call_center` ( + cc_call_center_sk Int64 NOT NULL, + cc_call_center_id Utf8, + cc_rec_start_date Date32, + cc_rec_end_date Date32, + cc_closed_date_sk Int64, + cc_open_date_sk Int64, + cc_name Utf8, + cc_class Utf8, + cc_employees Int64, + cc_sq_ft Int64, + cc_hours Utf8, + cc_manager Utf8, + cc_mkt_id Int64, + cc_mkt_class Utf8, + cc_mkt_desc Utf8, + cc_market_manager Utf8, + cc_division Int64, + cc_division_name Utf8, + cc_company Int64, + cc_company_name Utf8, + cc_street_number Utf8, + cc_street_name Utf8, + cc_street_type Utf8, + cc_suite_number Utf8, + cc_city Utf8, + cc_county Utf8, + cc_state Utf8, + cc_zip Utf8, + cc_country Utf8, + cc_gmt_offset Decimal(5,2), + cc_tax_percentage Decimal(5,2), + PRIMARY KEY (cc_call_center_sk) ) -PARTITION BY HASH(cc_call_center_sk) +PARTITION BY HASH (cc_call_center_sk) WITH ( -STORE = COLUMN, --"/call_center/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/customer` -( - c_customer_sk Int64 NOT NULL, - c_customer_id Utf8, - c_current_cdemo_sk Int64 , - c_current_hdemo_sk Int64 , - c_current_addr_sk Int64 , - c_first_shipto_date_sk Int64 , - c_first_sales_date_sk Int64 , - c_salutation Utf8, - c_first_name Utf8, - c_last_name Utf8, - c_preferred_cust_flag Utf8, - c_birth_day Int64 , - c_birth_month Int64 , - c_birth_year Int64 , - c_birth_country Utf8, - c_login Utf8, - c_email_address Utf8, - c_last_review_date Utf8 - , PRIMARY KEY (c_customer_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/customer` ( + c_customer_sk Int64 NOT NULL, + c_customer_id Utf8, + c_current_cdemo_sk Int64, + c_current_hdemo_sk Int64, + c_current_addr_sk Int64, + c_first_shipto_date_sk Int64, + c_first_sales_date_sk Int64, + c_salutation Utf8, + c_first_name Utf8, + c_last_name Utf8, + c_preferred_cust_flag Utf8, + c_birth_day Int64, + c_birth_month Int64, + c_birth_year Int64, + c_birth_country Utf8, + c_login Utf8, + c_email_address Utf8, + c_last_review_date Utf8, + PRIMARY KEY (c_customer_sk) ) -PARTITION BY HASH(c_customer_sk) +PARTITION BY HASH (c_customer_sk) WITH ( -STORE = COLUMN, --"/customer/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/web_site` -( - web_site_sk Int64 NOT NULL, - web_site_id Utf8, - web_rec_start_date Date32 , - web_rec_end_date Date32 , - web_name Utf8, - web_open_date_sk Int64 , - web_close_date_sk Int64 , - web_class Utf8, - web_manager Utf8, - web_mkt_id Int64 , - web_mkt_class Utf8, - web_mkt_desc Utf8, - web_market_manager Utf8, - web_company_id Int64 , - web_company_name Utf8, - web_street_number Utf8, - web_street_name Utf8, - web_street_type Utf8, - web_suite_number Utf8, - web_city Utf8, - web_county Utf8, - web_state Utf8, - web_zip Utf8, - web_country Utf8, - web_gmt_offset Decimal(5,2), - web_tax_percentage Decimal(5,2) - , PRIMARY KEY (web_site_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/web_site` ( + web_site_sk Int64 NOT NULL, + web_site_id Utf8, + web_rec_start_date Date32, + web_rec_end_date Date32, + web_name Utf8, + web_open_date_sk Int64, + web_close_date_sk Int64, + web_class Utf8, + web_manager Utf8, + web_mkt_id Int64, + web_mkt_class Utf8, + web_mkt_desc Utf8, + web_market_manager Utf8, + web_company_id Int64, + web_company_name Utf8, + web_street_number Utf8, + web_street_name Utf8, + web_street_type Utf8, + web_suite_number Utf8, + web_city Utf8, + web_county Utf8, + web_state Utf8, + web_zip Utf8, + web_country Utf8, + web_gmt_offset Decimal(5,2), + web_tax_percentage Decimal(5,2), + PRIMARY KEY (web_site_sk) ) -PARTITION BY HASH(web_site_sk) +PARTITION BY HASH (web_site_sk) WITH ( -STORE = COLUMN, --"/web_site/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/store_returns` -( - sr_returned_date_sk Int64 , - sr_return_time_sk Int64 , - sr_item_sk Int64 NOT NULL, - sr_customer_sk Int64 , - sr_cdemo_sk Int64 , - sr_hdemo_sk Int64 , - sr_addr_sk Int64 , - sr_store_sk Int64 , - sr_reason_sk Int64 , - sr_ticket_number Int64 NOT NULL, - sr_return_quantity Int64 , - sr_return_amt Decimal(7,2), - sr_return_tax Decimal(7,2), - sr_return_amt_inc_tax Decimal(7,2), - sr_fee Decimal(7,2), - sr_return_ship_cost Decimal(15,2), - sr_refunded_cash Decimal(7,2), - sr_reversed_charge Decimal(7,2), - sr_store_credit Decimal(7,2), - sr_net_loss Decimal(7,2) - , PRIMARY KEY (sr_item_sk, sr_ticket_number) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/store_returns` ( + sr_returned_date_sk Int64, + sr_return_time_sk Int64, + sr_item_sk Int64 NOT NULL, + sr_customer_sk Int64, + sr_cdemo_sk Int64, + sr_hdemo_sk Int64, + sr_addr_sk Int64, + sr_store_sk Int64, + sr_reason_sk Int64, + sr_ticket_number Int64 NOT NULL, + sr_return_quantity Int64, + sr_return_amt Decimal(7,2), + sr_return_tax Decimal(7,2), + sr_return_amt_inc_tax Decimal(7,2), + sr_fee Decimal(7,2), + sr_return_ship_cost Decimal(15,2), + sr_refunded_cash Decimal(7,2), + sr_reversed_charge Decimal(7,2), + sr_store_credit Decimal(7,2), + sr_net_loss Decimal(7,2), + PRIMARY KEY (sr_item_sk, sr_ticket_number) ) -PARTITION BY HASH(sr_item_sk, sr_ticket_number) +PARTITION BY HASH (sr_item_sk, sr_ticket_number) WITH ( -STORE = COLUMN, --"/store_returns/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/household_demographics` -( - hd_demo_sk Int64 NOT NULL, - hd_income_band_sk Int64 , - hd_buy_potential Utf8, - hd_dep_count Int64 , - hd_vehicle_count Int64 - , PRIMARY KEY (hd_demo_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/household_demographics` ( + hd_demo_sk Int64 NOT NULL, + hd_income_band_sk Int64, + hd_buy_potential Utf8, + hd_dep_count Int64, + hd_vehicle_count Int64, + PRIMARY KEY (hd_demo_sk) ) -PARTITION BY HASH(hd_demo_sk) +PARTITION BY HASH (hd_demo_sk) WITH ( -STORE = COLUMN, --"/household_demographics/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/web_page` -( - wp_web_page_sk Int64 NOT NULL, - wp_web_page_id Utf8, - wp_rec_start_date Date32 , - wp_rec_end_date Date32 , - wp_creation_date_sk Int64 , - wp_access_date_sk Int64 , - wp_autogen_flag Utf8, - wp_customer_sk Int64 , - wp_url Utf8, - wp_type Utf8, - wp_char_count Int64 , - wp_link_count Int64 , - wp_image_count Int64 , - wp_max_ad_count Int64 - , PRIMARY KEY (wp_web_page_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/web_page` ( + wp_web_page_sk Int64 NOT NULL, + wp_web_page_id Utf8, + wp_rec_start_date Date32, + wp_rec_end_date Date32, + wp_creation_date_sk Int64, + wp_access_date_sk Int64, + wp_autogen_flag Utf8, + wp_customer_sk Int64, + wp_url Utf8, + wp_type Utf8, + wp_char_count Int64, + wp_link_count Int64, + wp_image_count Int64, + wp_max_ad_count Int64, + PRIMARY KEY (wp_web_page_sk) ) -PARTITION BY HASH(wp_web_page_sk) +PARTITION BY HASH (wp_web_page_sk) WITH ( -STORE = COLUMN, --"/web_page/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/promotion` -( - p_promo_sk Int64 NOT NULL, - p_promo_id Utf8, - p_start_date_sk Int64 , - p_end_date_sk Int64 , - p_item_sk Int64 , - p_cost Decimal(7,2), - p_response_target Int64 , - p_promo_name Utf8, - p_channel_dmail Utf8, - p_channel_email Utf8, - p_channel_catalog Utf8, - p_channel_tv Utf8, - p_channel_radio Utf8, - p_channel_press Utf8, - p_channel_event Utf8, - p_channel_demo Utf8, - p_channel_details Utf8, - p_purpose Utf8, - p_discount_active Utf8 - , PRIMARY KEY (p_promo_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/promotion` ( + p_promo_sk Int64 NOT NULL, + p_promo_id Utf8, + p_start_date_sk Int64, + p_end_date_sk Int64, + p_item_sk Int64, + p_cost Decimal(7,2), + p_response_target Int64, + p_promo_name Utf8, + p_channel_dmail Utf8, + p_channel_email Utf8, + p_channel_catalog Utf8, + p_channel_tv Utf8, + p_channel_radio Utf8, + p_channel_press Utf8, + p_channel_event Utf8, + p_channel_demo Utf8, + p_channel_details Utf8, + p_purpose Utf8, + p_discount_active Utf8, + PRIMARY KEY (p_promo_sk) ) -PARTITION BY HASH(p_promo_sk) +PARTITION BY HASH (p_promo_sk) WITH ( -STORE = COLUMN, --"/promotion/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/catalog_page` -( - cp_catalog_page_sk Int64 NOT NULL, - cp_catalog_page_id Utf8, - cp_start_date_sk Int64 , - cp_end_date_sk Int64 , - cp_department Utf8, - cp_catalog_number Int64 , - cp_catalog_page_number Int64 , - cp_description Utf8, - cp_type Utf8 - , PRIMARY KEY (cp_catalog_page_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/catalog_page` ( + cp_catalog_page_sk Int64 NOT NULL, + cp_catalog_page_id Utf8, + cp_start_date_sk Int64, + cp_end_date_sk Int64, + cp_department Utf8, + cp_catalog_number Int64, + cp_catalog_page_number Int64, + cp_description Utf8, + cp_type Utf8, + PRIMARY KEY (cp_catalog_page_sk) ) -PARTITION BY HASH(cp_catalog_page_sk) +PARTITION BY HASH (cp_catalog_page_sk) WITH ( -STORE = COLUMN, --"/catalog_page/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/inventory` -( - inv_date_sk Int64 NOT NULL, - inv_item_sk Int64 NOT NULL, - inv_warehouse_sk Int64 NOT NULL, - inv_quantity_on_hand Int64 - , PRIMARY KEY (inv_date_sk, inv_item_sk, inv_warehouse_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/inventory` ( + inv_date_sk Int64 NOT NULL, + inv_item_sk Int64 NOT NULL, + inv_warehouse_sk Int64 NOT NULL, + inv_quantity_on_hand Int64, + PRIMARY KEY (inv_date_sk, inv_item_sk, inv_warehouse_sk) ) -PARTITION BY HASH(inv_date_sk, inv_item_sk, inv_warehouse_sk) +PARTITION BY HASH (inv_date_sk, inv_item_sk, inv_warehouse_sk) WITH ( -STORE = COLUMN, --"/inventory/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/catalog_returns` -( - cr_returned_date_sk Int64 , - cr_returned_time_sk Int64 , - cr_item_sk Int64 NOT NULL, - cr_refunded_customer_sk Int64 , - cr_refunded_cdemo_sk Int64 , - cr_refunded_hdemo_sk Int64 , - cr_refunded_addr_sk Int64 , - cr_returning_customer_sk Int64 , - cr_returning_cdemo_sk Int64 , - cr_returning_hdemo_sk Int64 , - cr_returning_addr_sk Int64 , - cr_call_center_sk Int64 , - cr_catalog_page_sk Int64 , - cr_ship_mode_sk Int64 , - cr_warehouse_sk Int64 , - cr_reason_sk Int64 , - cr_order_number Int64 NOT NULL, - cr_return_quantity Int64 , - cr_return_amount Decimal(7,2), - cr_return_tax Decimal(7,2), - cr_return_amt_inc_tax Decimal(7,2), - cr_fee Decimal(7,2), - cr_return_ship_cost Decimal(7,2), - cr_refunded_cash Decimal(7,2), - cr_reversed_charge Decimal(7,2), - cr_store_credit Decimal(7,2), - cr_net_loss Decimal(7,2) - , PRIMARY KEY (cr_item_sk, cr_order_number) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/catalog_returns` ( + cr_returned_date_sk Int64, + cr_returned_time_sk Int64, + cr_item_sk Int64 NOT NULL, + cr_refunded_customer_sk Int64, + cr_refunded_cdemo_sk Int64, + cr_refunded_hdemo_sk Int64, + cr_refunded_addr_sk Int64, + cr_returning_customer_sk Int64, + cr_returning_cdemo_sk Int64, + cr_returning_hdemo_sk Int64, + cr_returning_addr_sk Int64, + cr_call_center_sk Int64, + cr_catalog_page_sk Int64, + cr_ship_mode_sk Int64, + cr_warehouse_sk Int64, + cr_reason_sk Int64, + cr_order_number Int64 NOT NULL, + cr_return_quantity Int64, + cr_return_amount Decimal(7,2), + cr_return_tax Decimal(7,2), + cr_return_amt_inc_tax Decimal(7,2), + cr_fee Decimal(7,2), + cr_return_ship_cost Decimal(7,2), + cr_refunded_cash Decimal(7,2), + cr_reversed_charge Decimal(7,2), + cr_store_credit Decimal(7,2), + cr_net_loss Decimal(7,2), + PRIMARY KEY (cr_item_sk, cr_order_number) ) -PARTITION BY HASH(cr_item_sk, cr_order_number) +PARTITION BY HASH (cr_item_sk, cr_order_number) WITH ( -STORE = COLUMN, --"/catalog_returns/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/web_returns` -( - wr_returned_date_sk Int64 , - wr_returned_time_sk Int64 , - wr_item_sk Int64 NOT NULL, - wr_refunded_customer_sk Int64 , - wr_refunded_cdemo_sk Int64 , - wr_refunded_hdemo_sk Int64 , - wr_refunded_addr_sk Int64 , - wr_returning_customer_sk Int64 , - wr_returning_cdemo_sk Int64 , - wr_returning_hdemo_sk Int64 , - wr_returning_addr_sk Int64 , - wr_web_page_sk Int64 , - wr_reason_sk Int64 , - wr_order_number Int64 NOT NULL, - wr_return_quantity Int64 , - wr_return_amt Decimal(7,2), - wr_return_tax Decimal(7,2), - wr_return_amt_inc_tax Decimal(7,2), - wr_fee Decimal(7,2), - wr_return_ship_cost Decimal(7,2), - wr_refunded_cash Decimal(7,2), - wr_reversed_charge Decimal(7,2), - wr_account_credit Decimal(7,2), - wr_net_loss Decimal(7,2) - , PRIMARY KEY (wr_item_sk, wr_order_number) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/web_returns` ( + wr_returned_date_sk Int64, + wr_returned_time_sk Int64, + wr_item_sk Int64 NOT NULL, + wr_refunded_customer_sk Int64, + wr_refunded_cdemo_sk Int64, + wr_refunded_hdemo_sk Int64, + wr_refunded_addr_sk Int64, + wr_returning_customer_sk Int64, + wr_returning_cdemo_sk Int64, + wr_returning_hdemo_sk Int64, + wr_returning_addr_sk Int64, + wr_web_page_sk Int64, + wr_reason_sk Int64, + wr_order_number Int64 NOT NULL, + wr_return_quantity Int64, + wr_return_amt Decimal(7,2), + wr_return_tax Decimal(7,2), + wr_return_amt_inc_tax Decimal(7,2), + wr_fee Decimal(7,2), + wr_return_ship_cost Decimal(7,2), + wr_refunded_cash Decimal(7,2), + wr_reversed_charge Decimal(7,2), + wr_account_credit Decimal(7,2), + wr_net_loss Decimal(7,2), + PRIMARY KEY (wr_item_sk, wr_order_number) ) -PARTITION BY HASH(wr_item_sk, wr_order_number) +PARTITION BY HASH (wr_item_sk, wr_order_number) WITH ( -STORE = COLUMN, --"/web_returns/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/web_sales` -( - ws_sold_date_sk Int64 , - ws_sold_time_sk Int64 , - ws_ship_date_sk Int64 , - ws_item_sk Int64 NOT NULL, - ws_bill_customer_sk Int64 , - ws_bill_cdemo_sk Int64 , - ws_bill_hdemo_sk Int64 , - ws_bill_addr_sk Int64 , - ws_ship_customer_sk Int64 , - ws_ship_cdemo_sk Int64 , - ws_ship_hdemo_sk Int64 , - ws_ship_addr_sk Int64 , - ws_web_page_sk Int64 , - ws_web_site_sk Int64 , - ws_ship_mode_sk Int64 , - ws_warehouse_sk Int64 , - ws_promo_sk Int64 , - ws_order_number Int64 NOT NULL, - ws_quantity Int64 , - ws_wholesale_cost Decimal(7,2), - ws_list_price Decimal(7,2), - ws_sales_price Decimal(7,2), - ws_ext_discount_amt Decimal(7,2), - ws_ext_sales_price Decimal(7,2), - ws_ext_wholesale_cost Decimal(7,2), - ws_ext_list_price Decimal(7,2), - ws_ext_tax Decimal(7,2), - ws_coupon_amt Decimal(7,2), - ws_ext_ship_cost Decimal(7,2), - ws_net_paid Decimal(7,2), - ws_net_paid_inc_tax Decimal(7,2), - ws_net_paid_inc_ship Decimal(7,2), - ws_net_paid_inc_ship_tax Decimal(7,2), - ws_net_profit Decimal(7,2) - , PRIMARY KEY (ws_item_sk, ws_order_number) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/web_sales` ( + ws_sold_date_sk Int64, + ws_sold_time_sk Int64, + ws_ship_date_sk Int64, + ws_item_sk Int64 NOT NULL, + ws_bill_customer_sk Int64, + ws_bill_cdemo_sk Int64, + ws_bill_hdemo_sk Int64, + ws_bill_addr_sk Int64, + ws_ship_customer_sk Int64, + ws_ship_cdemo_sk Int64, + ws_ship_hdemo_sk Int64, + ws_ship_addr_sk Int64, + ws_web_page_sk Int64, + ws_web_site_sk Int64, + ws_ship_mode_sk Int64, + ws_warehouse_sk Int64, + ws_promo_sk Int64, + ws_order_number Int64 NOT NULL, + ws_quantity Int64, + ws_wholesale_cost Decimal(7,2), + ws_list_price Decimal(7,2), + ws_sales_price Decimal(7,2), + ws_ext_discount_amt Decimal(7,2), + ws_ext_sales_price Decimal(7,2), + ws_ext_wholesale_cost Decimal(7,2), + ws_ext_list_price Decimal(7,2), + ws_ext_tax Decimal(7,2), + ws_coupon_amt Decimal(7,2), + ws_ext_ship_cost Decimal(7,2), + ws_net_paid Decimal(7,2), + ws_net_paid_inc_tax Decimal(7,2), + ws_net_paid_inc_ship Decimal(7,2), + ws_net_paid_inc_ship_tax Decimal(7,2), + ws_net_profit Decimal(7,2), + PRIMARY KEY (ws_item_sk, ws_order_number) ) -PARTITION BY HASH(ws_item_sk, ws_order_number) +PARTITION BY HASH (ws_item_sk, ws_order_number) WITH ( -STORE = COLUMN, --"/web_sales/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/catalog_sales` -( - cs_sold_date_sk Int64 , - cs_sold_time_sk Int64 , - cs_ship_date_sk Int64 , - cs_bill_customer_sk Int64 , - cs_bill_cdemo_sk Int64 , - cs_bill_hdemo_sk Int64 , - cs_bill_addr_sk Int64 , - cs_ship_customer_sk Int64 , - cs_ship_cdemo_sk Int64 , - cs_ship_hdemo_sk Int64 , - cs_ship_addr_sk Int64 , - cs_call_center_sk Int64 , - cs_catalog_page_sk Int64 , - cs_ship_mode_sk Int64 , - cs_warehouse_sk Int64 , - cs_item_sk Int64 NOT NULL, - cs_promo_sk Int64 , - cs_order_number Int64 NOT NULL, - cs_quantity Int64 , - cs_wholesale_cost Decimal(7,2), - cs_list_price Decimal(7,2), - cs_sales_price Decimal(7,2), - cs_ext_discount_amt Decimal(7,2), - cs_ext_sales_price Decimal(7,2), - cs_ext_wholesale_cost Decimal(7,2), - cs_ext_list_price Decimal(7,2), - cs_ext_tax Decimal(7,2), - cs_coupon_amt Decimal(7,2), - cs_ext_ship_cost Decimal(7,2), - cs_net_paid Decimal(7,2), - cs_net_paid_inc_tax Decimal(7,2), - cs_net_paid_inc_ship Decimal(7,2), - cs_net_paid_inc_ship_tax Decimal(7,2), - cs_net_profit Decimal(7,2) - , PRIMARY KEY (cs_item_sk, cs_order_number) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/catalog_sales` ( + cs_sold_date_sk Int64, + cs_sold_time_sk Int64, + cs_ship_date_sk Int64, + cs_bill_customer_sk Int64, + cs_bill_cdemo_sk Int64, + cs_bill_hdemo_sk Int64, + cs_bill_addr_sk Int64, + cs_ship_customer_sk Int64, + cs_ship_cdemo_sk Int64, + cs_ship_hdemo_sk Int64, + cs_ship_addr_sk Int64, + cs_call_center_sk Int64, + cs_catalog_page_sk Int64, + cs_ship_mode_sk Int64, + cs_warehouse_sk Int64, + cs_item_sk Int64 NOT NULL, + cs_promo_sk Int64, + cs_order_number Int64 NOT NULL, + cs_quantity Int64, + cs_wholesale_cost Decimal(7,2), + cs_list_price Decimal(7,2), + cs_sales_price Decimal(7,2), + cs_ext_discount_amt Decimal(7,2), + cs_ext_sales_price Decimal(7,2), + cs_ext_wholesale_cost Decimal(7,2), + cs_ext_list_price Decimal(7,2), + cs_ext_tax Decimal(7,2), + cs_coupon_amt Decimal(7,2), + cs_ext_ship_cost Decimal(7,2), + cs_net_paid Decimal(7,2), + cs_net_paid_inc_tax Decimal(7,2), + cs_net_paid_inc_ship Decimal(7,2), + cs_net_paid_inc_ship_tax Decimal(7,2), + cs_net_profit Decimal(7,2), + PRIMARY KEY (cs_item_sk, cs_order_number) ) -PARTITION BY HASH(cs_item_sk, cs_order_number) +PARTITION BY HASH (cs_item_sk, cs_order_number) WITH ( -STORE = COLUMN, --"/catalog_sales/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/store_sales` -( - ss_sold_date_sk Int64 , - ss_sold_time_sk Int64 , - ss_item_sk Int64 NOT NULL, - ss_customer_sk Int64 , - ss_cdemo_sk Int64 , - ss_hdemo_sk Int64 , - ss_addr_sk Int64 , - ss_store_sk Int64 , - ss_promo_sk Int64 , - ss_ticket_number Int64 NOT NULL, - ss_quantity Int64 , - ss_wholesale_cost Decimal(7,2), - ss_list_price Decimal(7,2), - ss_sales_price Decimal(7,2), - ss_ext_discount_amt Decimal(7,2), - ss_ext_sales_price Decimal(7,2), - ss_ext_wholesale_cost Decimal(7,2), - ss_ext_list_price Decimal(7,2), - ss_ext_tax Decimal(7,2), - ss_coupon_amt Decimal(7,2), - ss_net_paid Decimal(7,2), - ss_net_paid_inc_tax Decimal(7,2), - ss_net_profit Decimal(7,2) - , PRIMARY KEY (ss_item_sk, ss_ticket_number) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/store_sales` ( + ss_sold_date_sk Int64, + ss_sold_time_sk Int64, + ss_item_sk Int64 NOT NULL, + ss_customer_sk Int64, + ss_cdemo_sk Int64, + ss_hdemo_sk Int64, + ss_addr_sk Int64, + ss_store_sk Int64, + ss_promo_sk Int64, + ss_ticket_number Int64 NOT NULL, + ss_quantity Int64, + ss_wholesale_cost Decimal(7,2), + ss_list_price Decimal(7,2), + ss_sales_price Decimal(7,2), + ss_ext_discount_amt Decimal(7,2), + ss_ext_sales_price Decimal(7,2), + ss_ext_wholesale_cost Decimal(7,2), + ss_ext_list_price Decimal(7,2), + ss_ext_tax Decimal(7,2), + ss_coupon_amt Decimal(7,2), + ss_net_paid Decimal(7,2), + ss_net_paid_inc_tax Decimal(7,2), + ss_net_profit Decimal(7,2), + PRIMARY KEY (ss_item_sk, ss_ticket_number) ) -PARTITION BY HASH(ss_item_sk, ss_ticket_number) +PARTITION BY HASH (ss_item_sk, ss_ticket_number) WITH ( -STORE = COLUMN, --"/store_sales/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); Init tables ...Ok diff --git a/ydb/tests/functional/tpc/canondata/test_init.TestTpcdsInit.test_s1_column_decimal_ydb/s1_column_decimal_ydb b/ydb/tests/functional/tpc/canondata/test_init.TestTpcdsInit.test_s1_column_decimal_ydb/s1_column_decimal_ydb index 863cc73d1da9..30dda60b3077 100644 --- a/ydb/tests/functional/tpc/canondata/test_init.TestTpcdsInit.test_s1_column_decimal_ydb/s1_column_decimal_ydb +++ b/ydb/tests/functional/tpc/canondata/test_init.TestTpcdsInit.test_s1_column_decimal_ydb/s1_column_decimal_ydb @@ -1,669 +1,645 @@ Init tables ... +--!syntax_v1 - -CREATE TABLE `/Root/db/Root/db/tpcds/s1/customer_address` -( - ca_address_sk Int64 NOT NULL, - ca_address_id Utf8, - ca_street_number Utf8, - ca_street_name Utf8, - ca_street_type Utf8, - ca_suite_number Utf8, - ca_city Utf8, - ca_county Utf8, - ca_state Utf8, - ca_zip Utf8, - ca_country Utf8, - ca_gmt_offset Decimal(22,9) , - ca_location_type Utf8 - , PRIMARY KEY (ca_address_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/customer_address` ( + ca_address_sk Int64 NOT NULL, + ca_address_id Utf8, + ca_street_number Utf8, + ca_street_name Utf8, + ca_street_type Utf8, + ca_suite_number Utf8, + ca_city Utf8, + ca_county Utf8, + ca_state Utf8, + ca_zip Utf8, + ca_country Utf8, + ca_gmt_offset Decimal(22,9), + ca_location_type Utf8, + PRIMARY KEY (ca_address_sk) ) -PARTITION BY HASH(ca_address_sk) +PARTITION BY HASH (ca_address_sk) WITH ( -STORE = COLUMN, --"/customer_address/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/customer_demographics` -( - cd_demo_sk Int64 NOT NULL, - cd_gender Utf8, - cd_marital_status Utf8, - cd_education_status Utf8, - cd_purchase_estimate Int64 , - cd_credit_rating Utf8, - cd_dep_count Int64 , - cd_dep_employed_count Int64 , - cd_dep_college_count Int64 - , PRIMARY KEY (cd_demo_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/customer_demographics` ( + cd_demo_sk Int64 NOT NULL, + cd_gender Utf8, + cd_marital_status Utf8, + cd_education_status Utf8, + cd_purchase_estimate Int64, + cd_credit_rating Utf8, + cd_dep_count Int64, + cd_dep_employed_count Int64, + cd_dep_college_count Int64, + PRIMARY KEY (cd_demo_sk) ) -PARTITION BY HASH(cd_demo_sk) +PARTITION BY HASH (cd_demo_sk) WITH ( -STORE = COLUMN, --"/customer_demographics/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/date_dim` -( - d_date_sk Int64 NOT NULL, - d_date_id Utf8, - d_date Utf8, - d_month_seq Int64 , - d_week_seq Int64 , - d_quarter_seq Int64 , - d_year Int64 , - d_dow Int64 , - d_moy Int64 , - d_dom Int64 , - d_qoy Int64 , - d_fy_year Int64 , - d_fy_quarter_seq Int64 , - d_fy_week_seq Int64 , - d_day_name Utf8, - d_quarter_name Utf8, - d_holiday Utf8, - d_weekend Utf8, - d_following_holiday Utf8, - d_first_dom Int64 , - d_last_dom Int64 , - d_same_day_ly Int64 , - d_same_day_lq Int64 , - d_current_day Utf8, - d_current_week Utf8, - d_current_month Utf8, - d_current_quarter Utf8, - d_current_year Utf8 - , PRIMARY KEY (d_date_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/date_dim` ( + d_date_sk Int64 NOT NULL, + d_date_id Utf8, + d_date Utf8, + d_month_seq Int64, + d_week_seq Int64, + d_quarter_seq Int64, + d_year Int64, + d_dow Int64, + d_moy Int64, + d_dom Int64, + d_qoy Int64, + d_fy_year Int64, + d_fy_quarter_seq Int64, + d_fy_week_seq Int64, + d_day_name Utf8, + d_quarter_name Utf8, + d_holiday Utf8, + d_weekend Utf8, + d_following_holiday Utf8, + d_first_dom Int64, + d_last_dom Int64, + d_same_day_ly Int64, + d_same_day_lq Int64, + d_current_day Utf8, + d_current_week Utf8, + d_current_month Utf8, + d_current_quarter Utf8, + d_current_year Utf8, + PRIMARY KEY (d_date_sk) ) -PARTITION BY HASH(d_date_sk) +PARTITION BY HASH (d_date_sk) WITH ( -STORE = COLUMN, --"/date_dim/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/warehouse` -( - w_warehouse_sk Int64 NOT NULL, - w_warehouse_id Utf8, - w_warehouse_name Utf8, - w_warehouse_sq_ft Int64 , - w_street_number Utf8, - w_street_name Utf8, - w_street_type Utf8, - w_suite_number Utf8, - w_city Utf8, - w_county Utf8, - w_state Utf8, - w_zip Utf8, - w_country Utf8, - w_gmt_offset Decimal(22,9) - , PRIMARY KEY (w_warehouse_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/warehouse` ( + w_warehouse_sk Int64 NOT NULL, + w_warehouse_id Utf8, + w_warehouse_name Utf8, + w_warehouse_sq_ft Int64, + w_street_number Utf8, + w_street_name Utf8, + w_street_type Utf8, + w_suite_number Utf8, + w_city Utf8, + w_county Utf8, + w_state Utf8, + w_zip Utf8, + w_country Utf8, + w_gmt_offset Decimal(22,9), + PRIMARY KEY (w_warehouse_sk) ) -PARTITION BY HASH(w_warehouse_sk) +PARTITION BY HASH (w_warehouse_sk) WITH ( -STORE = COLUMN, --"/warehouse/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/ship_mode` -( - sm_ship_mode_sk Int64 NOT NULL, - sm_ship_mode_id Utf8, - sm_type Utf8, - sm_code Utf8, - sm_carrier Utf8, - sm_contract Utf8 - , PRIMARY KEY (sm_ship_mode_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/ship_mode` ( + sm_ship_mode_sk Int64 NOT NULL, + sm_ship_mode_id Utf8, + sm_type Utf8, + sm_code Utf8, + sm_carrier Utf8, + sm_contract Utf8, + PRIMARY KEY (sm_ship_mode_sk) ) -PARTITION BY HASH(sm_ship_mode_sk) +PARTITION BY HASH (sm_ship_mode_sk) WITH ( -STORE = COLUMN, --"/ship_mode/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/time_dim` -( - t_time_sk Int64 NOT NULL, - t_time_id Utf8, - t_time Int64 , - t_hour Int64 , - t_minute Int64 , - t_second Int64 , - t_am_pm Utf8, - t_shift Utf8, - t_sub_shift Utf8, - t_meal_time Utf8 - , PRIMARY KEY (t_time_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/time_dim` ( + t_time_sk Int64 NOT NULL, + t_time_id Utf8, + t_time Int64, + t_hour Int64, + t_minute Int64, + t_second Int64, + t_am_pm Utf8, + t_shift Utf8, + t_sub_shift Utf8, + t_meal_time Utf8, + PRIMARY KEY (t_time_sk) ) -PARTITION BY HASH(t_time_sk) +PARTITION BY HASH (t_time_sk) WITH ( -STORE = COLUMN, --"/time_dim/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/reason` -( - r_reason_sk Int64 NOT NULL, - r_reason_id Utf8, - r_reason_desc Utf8 - , PRIMARY KEY (r_reason_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/reason` ( + r_reason_sk Int64 NOT NULL, + r_reason_id Utf8, + r_reason_desc Utf8, + PRIMARY KEY (r_reason_sk) ) -PARTITION BY HASH(r_reason_sk) +PARTITION BY HASH (r_reason_sk) WITH ( -STORE = COLUMN, --"/reason/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/income_band` -( - ib_income_band_sk Int64 NOT NULL, - ib_lower_bound Int64 , - ib_upper_bound Int64 - , PRIMARY KEY (ib_income_band_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/income_band` ( + ib_income_band_sk Int64 NOT NULL, + ib_lower_bound Int64, + ib_upper_bound Int64, + PRIMARY KEY (ib_income_band_sk) ) -PARTITION BY HASH(ib_income_band_sk) +PARTITION BY HASH (ib_income_band_sk) WITH ( -STORE = COLUMN, --"/income_band/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/item` -( - i_item_sk Int64 NOT NULL, - i_item_id Utf8, - i_rec_start_date Date32 , - i_rec_end_date Date32 , - i_item_desc Utf8, - i_current_price Decimal(22,9), - i_wholesale_cost Decimal(22,9), - i_brand_id Int64 , - i_brand Utf8, - i_class_id Int64 , - i_class Utf8, - i_category_id Int64 , - i_category Utf8, - i_manufact_id Int64 , - i_manufact Utf8, - i_size Utf8, - i_formulation Utf8, - i_color Utf8, - i_units Utf8, - i_container Utf8, - i_manager_id Int64 , - i_product_name Utf8 - , PRIMARY KEY (i_item_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/item` ( + i_item_sk Int64 NOT NULL, + i_item_id Utf8, + i_rec_start_date Date32, + i_rec_end_date Date32, + i_item_desc Utf8, + i_current_price Decimal(22,9), + i_wholesale_cost Decimal(22,9), + i_brand_id Int64, + i_brand Utf8, + i_class_id Int64, + i_class Utf8, + i_category_id Int64, + i_category Utf8, + i_manufact_id Int64, + i_manufact Utf8, + i_size Utf8, + i_formulation Utf8, + i_color Utf8, + i_units Utf8, + i_container Utf8, + i_manager_id Int64, + i_product_name Utf8, + PRIMARY KEY (i_item_sk) ) -PARTITION BY HASH(i_item_sk) +PARTITION BY HASH (i_item_sk) WITH ( -STORE = COLUMN, --"/item/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/store` -( - s_store_sk Int64 NOT NULL, - s_store_id Utf8, - s_rec_start_date Date32 , - s_rec_end_date Date32 , - s_closed_date_sk Int64 , - s_store_name Utf8, - s_number_employees Int64 , - s_floor_space Int64 , - s_hours Utf8, - s_manager Utf8, - s_market_id Int64 , - s_geography_class Utf8, - s_market_desc Utf8, - s_market_manager Utf8, - s_division_id Int64 , - s_division_name Utf8, - s_company_id Int64 , - s_company_name Utf8, - s_street_number Utf8, - s_street_name Utf8, - s_street_type Utf8, - s_suite_number Utf8, - s_city Utf8, - s_county Utf8, - s_state Utf8, - s_zip Utf8, - s_country Utf8, - s_gmt_offset Decimal(22,9), - s_tax_precentage Decimal(22,9) - , PRIMARY KEY (s_store_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/store` ( + s_store_sk Int64 NOT NULL, + s_store_id Utf8, + s_rec_start_date Date32, + s_rec_end_date Date32, + s_closed_date_sk Int64, + s_store_name Utf8, + s_number_employees Int64, + s_floor_space Int64, + s_hours Utf8, + s_manager Utf8, + s_market_id Int64, + s_geography_class Utf8, + s_market_desc Utf8, + s_market_manager Utf8, + s_division_id Int64, + s_division_name Utf8, + s_company_id Int64, + s_company_name Utf8, + s_street_number Utf8, + s_street_name Utf8, + s_street_type Utf8, + s_suite_number Utf8, + s_city Utf8, + s_county Utf8, + s_state Utf8, + s_zip Utf8, + s_country Utf8, + s_gmt_offset Decimal(22,9), + s_tax_precentage Decimal(22,9), + PRIMARY KEY (s_store_sk) ) -PARTITION BY HASH(s_store_sk) +PARTITION BY HASH (s_store_sk) WITH ( -STORE = COLUMN, --"/store/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/call_center` -( - cc_call_center_sk Int64 NOT NULL, - cc_call_center_id Utf8, - cc_rec_start_date Date32 , - cc_rec_end_date Date32 , - cc_closed_date_sk Int64 , - cc_open_date_sk Int64 , - cc_name Utf8, - cc_class Utf8, - cc_employees Int64 , - cc_sq_ft Int64 , - cc_hours Utf8, - cc_manager Utf8, - cc_mkt_id Int64 , - cc_mkt_class Utf8, - cc_mkt_desc Utf8, - cc_market_manager Utf8, - cc_division Int64 , - cc_division_name Utf8, - cc_company Int64 , - cc_company_name Utf8, - cc_street_number Utf8, - cc_street_name Utf8, - cc_street_type Utf8, - cc_suite_number Utf8, - cc_city Utf8, - cc_county Utf8, - cc_state Utf8, - cc_zip Utf8, - cc_country Utf8, - cc_gmt_offset Decimal(22,9), - cc_tax_percentage Decimal(22,9) - , PRIMARY KEY (cc_call_center_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/call_center` ( + cc_call_center_sk Int64 NOT NULL, + cc_call_center_id Utf8, + cc_rec_start_date Date32, + cc_rec_end_date Date32, + cc_closed_date_sk Int64, + cc_open_date_sk Int64, + cc_name Utf8, + cc_class Utf8, + cc_employees Int64, + cc_sq_ft Int64, + cc_hours Utf8, + cc_manager Utf8, + cc_mkt_id Int64, + cc_mkt_class Utf8, + cc_mkt_desc Utf8, + cc_market_manager Utf8, + cc_division Int64, + cc_division_name Utf8, + cc_company Int64, + cc_company_name Utf8, + cc_street_number Utf8, + cc_street_name Utf8, + cc_street_type Utf8, + cc_suite_number Utf8, + cc_city Utf8, + cc_county Utf8, + cc_state Utf8, + cc_zip Utf8, + cc_country Utf8, + cc_gmt_offset Decimal(22,9), + cc_tax_percentage Decimal(22,9), + PRIMARY KEY (cc_call_center_sk) ) -PARTITION BY HASH(cc_call_center_sk) +PARTITION BY HASH (cc_call_center_sk) WITH ( -STORE = COLUMN, --"/call_center/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/customer` -( - c_customer_sk Int64 NOT NULL, - c_customer_id Utf8, - c_current_cdemo_sk Int64 , - c_current_hdemo_sk Int64 , - c_current_addr_sk Int64 , - c_first_shipto_date_sk Int64 , - c_first_sales_date_sk Int64 , - c_salutation Utf8, - c_first_name Utf8, - c_last_name Utf8, - c_preferred_cust_flag Utf8, - c_birth_day Int64 , - c_birth_month Int64 , - c_birth_year Int64 , - c_birth_country Utf8, - c_login Utf8, - c_email_address Utf8, - c_last_review_date Utf8 - , PRIMARY KEY (c_customer_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/customer` ( + c_customer_sk Int64 NOT NULL, + c_customer_id Utf8, + c_current_cdemo_sk Int64, + c_current_hdemo_sk Int64, + c_current_addr_sk Int64, + c_first_shipto_date_sk Int64, + c_first_sales_date_sk Int64, + c_salutation Utf8, + c_first_name Utf8, + c_last_name Utf8, + c_preferred_cust_flag Utf8, + c_birth_day Int64, + c_birth_month Int64, + c_birth_year Int64, + c_birth_country Utf8, + c_login Utf8, + c_email_address Utf8, + c_last_review_date Utf8, + PRIMARY KEY (c_customer_sk) ) -PARTITION BY HASH(c_customer_sk) +PARTITION BY HASH (c_customer_sk) WITH ( -STORE = COLUMN, --"/customer/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/web_site` -( - web_site_sk Int64 NOT NULL, - web_site_id Utf8, - web_rec_start_date Date32 , - web_rec_end_date Date32 , - web_name Utf8, - web_open_date_sk Int64 , - web_close_date_sk Int64 , - web_class Utf8, - web_manager Utf8, - web_mkt_id Int64 , - web_mkt_class Utf8, - web_mkt_desc Utf8, - web_market_manager Utf8, - web_company_id Int64 , - web_company_name Utf8, - web_street_number Utf8, - web_street_name Utf8, - web_street_type Utf8, - web_suite_number Utf8, - web_city Utf8, - web_county Utf8, - web_state Utf8, - web_zip Utf8, - web_country Utf8, - web_gmt_offset Decimal(22,9), - web_tax_percentage Decimal(22,9) - , PRIMARY KEY (web_site_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/web_site` ( + web_site_sk Int64 NOT NULL, + web_site_id Utf8, + web_rec_start_date Date32, + web_rec_end_date Date32, + web_name Utf8, + web_open_date_sk Int64, + web_close_date_sk Int64, + web_class Utf8, + web_manager Utf8, + web_mkt_id Int64, + web_mkt_class Utf8, + web_mkt_desc Utf8, + web_market_manager Utf8, + web_company_id Int64, + web_company_name Utf8, + web_street_number Utf8, + web_street_name Utf8, + web_street_type Utf8, + web_suite_number Utf8, + web_city Utf8, + web_county Utf8, + web_state Utf8, + web_zip Utf8, + web_country Utf8, + web_gmt_offset Decimal(22,9), + web_tax_percentage Decimal(22,9), + PRIMARY KEY (web_site_sk) ) -PARTITION BY HASH(web_site_sk) +PARTITION BY HASH (web_site_sk) WITH ( -STORE = COLUMN, --"/web_site/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/store_returns` -( - sr_returned_date_sk Int64 , - sr_return_time_sk Int64 , - sr_item_sk Int64 NOT NULL, - sr_customer_sk Int64 , - sr_cdemo_sk Int64 , - sr_hdemo_sk Int64 , - sr_addr_sk Int64 , - sr_store_sk Int64 , - sr_reason_sk Int64 , - sr_ticket_number Int64 NOT NULL, - sr_return_quantity Int64 , - sr_return_amt Decimal(22,9), - sr_return_tax Decimal(22,9), - sr_return_amt_inc_tax Decimal(22,9), - sr_fee Decimal(22,9), - sr_return_ship_cost Decimal(22,9), - sr_refunded_cash Decimal(22,9), - sr_reversed_charge Decimal(22,9), - sr_store_credit Decimal(22,9), - sr_net_loss Decimal(22,9) - , PRIMARY KEY (sr_item_sk, sr_ticket_number) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/store_returns` ( + sr_returned_date_sk Int64, + sr_return_time_sk Int64, + sr_item_sk Int64 NOT NULL, + sr_customer_sk Int64, + sr_cdemo_sk Int64, + sr_hdemo_sk Int64, + sr_addr_sk Int64, + sr_store_sk Int64, + sr_reason_sk Int64, + sr_ticket_number Int64 NOT NULL, + sr_return_quantity Int64, + sr_return_amt Decimal(22,9), + sr_return_tax Decimal(22,9), + sr_return_amt_inc_tax Decimal(22,9), + sr_fee Decimal(22,9), + sr_return_ship_cost Decimal(22,9), + sr_refunded_cash Decimal(22,9), + sr_reversed_charge Decimal(22,9), + sr_store_credit Decimal(22,9), + sr_net_loss Decimal(22,9), + PRIMARY KEY (sr_item_sk, sr_ticket_number) ) -PARTITION BY HASH(sr_item_sk, sr_ticket_number) +PARTITION BY HASH (sr_item_sk, sr_ticket_number) WITH ( -STORE = COLUMN, --"/store_returns/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/household_demographics` -( - hd_demo_sk Int64 NOT NULL, - hd_income_band_sk Int64 , - hd_buy_potential Utf8, - hd_dep_count Int64 , - hd_vehicle_count Int64 - , PRIMARY KEY (hd_demo_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/household_demographics` ( + hd_demo_sk Int64 NOT NULL, + hd_income_band_sk Int64, + hd_buy_potential Utf8, + hd_dep_count Int64, + hd_vehicle_count Int64, + PRIMARY KEY (hd_demo_sk) ) -PARTITION BY HASH(hd_demo_sk) +PARTITION BY HASH (hd_demo_sk) WITH ( -STORE = COLUMN, --"/household_demographics/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/web_page` -( - wp_web_page_sk Int64 NOT NULL, - wp_web_page_id Utf8, - wp_rec_start_date Date32 , - wp_rec_end_date Date32 , - wp_creation_date_sk Int64 , - wp_access_date_sk Int64 , - wp_autogen_flag Utf8, - wp_customer_sk Int64 , - wp_url Utf8, - wp_type Utf8, - wp_char_count Int64 , - wp_link_count Int64 , - wp_image_count Int64 , - wp_max_ad_count Int64 - , PRIMARY KEY (wp_web_page_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/web_page` ( + wp_web_page_sk Int64 NOT NULL, + wp_web_page_id Utf8, + wp_rec_start_date Date32, + wp_rec_end_date Date32, + wp_creation_date_sk Int64, + wp_access_date_sk Int64, + wp_autogen_flag Utf8, + wp_customer_sk Int64, + wp_url Utf8, + wp_type Utf8, + wp_char_count Int64, + wp_link_count Int64, + wp_image_count Int64, + wp_max_ad_count Int64, + PRIMARY KEY (wp_web_page_sk) ) -PARTITION BY HASH(wp_web_page_sk) +PARTITION BY HASH (wp_web_page_sk) WITH ( -STORE = COLUMN, --"/web_page/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/promotion` -( - p_promo_sk Int64 NOT NULL, - p_promo_id Utf8, - p_start_date_sk Int64 , - p_end_date_sk Int64 , - p_item_sk Int64 , - p_cost Decimal(22,9), - p_response_target Int64 , - p_promo_name Utf8, - p_channel_dmail Utf8, - p_channel_email Utf8, - p_channel_catalog Utf8, - p_channel_tv Utf8, - p_channel_radio Utf8, - p_channel_press Utf8, - p_channel_event Utf8, - p_channel_demo Utf8, - p_channel_details Utf8, - p_purpose Utf8, - p_discount_active Utf8 - , PRIMARY KEY (p_promo_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/promotion` ( + p_promo_sk Int64 NOT NULL, + p_promo_id Utf8, + p_start_date_sk Int64, + p_end_date_sk Int64, + p_item_sk Int64, + p_cost Decimal(22,9), + p_response_target Int64, + p_promo_name Utf8, + p_channel_dmail Utf8, + p_channel_email Utf8, + p_channel_catalog Utf8, + p_channel_tv Utf8, + p_channel_radio Utf8, + p_channel_press Utf8, + p_channel_event Utf8, + p_channel_demo Utf8, + p_channel_details Utf8, + p_purpose Utf8, + p_discount_active Utf8, + PRIMARY KEY (p_promo_sk) ) -PARTITION BY HASH(p_promo_sk) +PARTITION BY HASH (p_promo_sk) WITH ( -STORE = COLUMN, --"/promotion/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/catalog_page` -( - cp_catalog_page_sk Int64 NOT NULL, - cp_catalog_page_id Utf8, - cp_start_date_sk Int64 , - cp_end_date_sk Int64 , - cp_department Utf8, - cp_catalog_number Int64 , - cp_catalog_page_number Int64 , - cp_description Utf8, - cp_type Utf8 - , PRIMARY KEY (cp_catalog_page_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/catalog_page` ( + cp_catalog_page_sk Int64 NOT NULL, + cp_catalog_page_id Utf8, + cp_start_date_sk Int64, + cp_end_date_sk Int64, + cp_department Utf8, + cp_catalog_number Int64, + cp_catalog_page_number Int64, + cp_description Utf8, + cp_type Utf8, + PRIMARY KEY (cp_catalog_page_sk) ) -PARTITION BY HASH(cp_catalog_page_sk) +PARTITION BY HASH (cp_catalog_page_sk) WITH ( -STORE = COLUMN, --"/catalog_page/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/inventory` -( - inv_date_sk Int64 NOT NULL, - inv_item_sk Int64 NOT NULL, - inv_warehouse_sk Int64 NOT NULL, - inv_quantity_on_hand Int64 - , PRIMARY KEY (inv_date_sk, inv_item_sk, inv_warehouse_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/inventory` ( + inv_date_sk Int64 NOT NULL, + inv_item_sk Int64 NOT NULL, + inv_warehouse_sk Int64 NOT NULL, + inv_quantity_on_hand Int64, + PRIMARY KEY (inv_date_sk, inv_item_sk, inv_warehouse_sk) ) -PARTITION BY HASH(inv_date_sk, inv_item_sk, inv_warehouse_sk) +PARTITION BY HASH (inv_date_sk, inv_item_sk, inv_warehouse_sk) WITH ( -STORE = COLUMN, --"/inventory/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/catalog_returns` -( - cr_returned_date_sk Int64 , - cr_returned_time_sk Int64 , - cr_item_sk Int64 NOT NULL, - cr_refunded_customer_sk Int64 , - cr_refunded_cdemo_sk Int64 , - cr_refunded_hdemo_sk Int64 , - cr_refunded_addr_sk Int64 , - cr_returning_customer_sk Int64 , - cr_returning_cdemo_sk Int64 , - cr_returning_hdemo_sk Int64 , - cr_returning_addr_sk Int64 , - cr_call_center_sk Int64 , - cr_catalog_page_sk Int64 , - cr_ship_mode_sk Int64 , - cr_warehouse_sk Int64 , - cr_reason_sk Int64 , - cr_order_number Int64 NOT NULL, - cr_return_quantity Int64 , - cr_return_amount Decimal(22,9), - cr_return_tax Decimal(22,9), - cr_return_amt_inc_tax Decimal(22,9), - cr_fee Decimal(22,9), - cr_return_ship_cost Decimal(22,9), - cr_refunded_cash Decimal(22,9), - cr_reversed_charge Decimal(22,9), - cr_store_credit Decimal(22,9), - cr_net_loss Decimal(22,9) - , PRIMARY KEY (cr_item_sk, cr_order_number) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/catalog_returns` ( + cr_returned_date_sk Int64, + cr_returned_time_sk Int64, + cr_item_sk Int64 NOT NULL, + cr_refunded_customer_sk Int64, + cr_refunded_cdemo_sk Int64, + cr_refunded_hdemo_sk Int64, + cr_refunded_addr_sk Int64, + cr_returning_customer_sk Int64, + cr_returning_cdemo_sk Int64, + cr_returning_hdemo_sk Int64, + cr_returning_addr_sk Int64, + cr_call_center_sk Int64, + cr_catalog_page_sk Int64, + cr_ship_mode_sk Int64, + cr_warehouse_sk Int64, + cr_reason_sk Int64, + cr_order_number Int64 NOT NULL, + cr_return_quantity Int64, + cr_return_amount Decimal(22,9), + cr_return_tax Decimal(22,9), + cr_return_amt_inc_tax Decimal(22,9), + cr_fee Decimal(22,9), + cr_return_ship_cost Decimal(22,9), + cr_refunded_cash Decimal(22,9), + cr_reversed_charge Decimal(22,9), + cr_store_credit Decimal(22,9), + cr_net_loss Decimal(22,9), + PRIMARY KEY (cr_item_sk, cr_order_number) ) -PARTITION BY HASH(cr_item_sk, cr_order_number) +PARTITION BY HASH (cr_item_sk, cr_order_number) WITH ( -STORE = COLUMN, --"/catalog_returns/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/web_returns` -( - wr_returned_date_sk Int64 , - wr_returned_time_sk Int64 , - wr_item_sk Int64 NOT NULL, - wr_refunded_customer_sk Int64 , - wr_refunded_cdemo_sk Int64 , - wr_refunded_hdemo_sk Int64 , - wr_refunded_addr_sk Int64 , - wr_returning_customer_sk Int64 , - wr_returning_cdemo_sk Int64 , - wr_returning_hdemo_sk Int64 , - wr_returning_addr_sk Int64 , - wr_web_page_sk Int64 , - wr_reason_sk Int64 , - wr_order_number Int64 NOT NULL, - wr_return_quantity Int64 , - wr_return_amt Decimal(22,9), - wr_return_tax Decimal(22,9), - wr_return_amt_inc_tax Decimal(22,9), - wr_fee Decimal(22,9), - wr_return_ship_cost Decimal(22,9), - wr_refunded_cash Decimal(22,9), - wr_reversed_charge Decimal(22,9), - wr_account_credit Decimal(22,9), - wr_net_loss Decimal(22,9) - , PRIMARY KEY (wr_item_sk, wr_order_number) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/web_returns` ( + wr_returned_date_sk Int64, + wr_returned_time_sk Int64, + wr_item_sk Int64 NOT NULL, + wr_refunded_customer_sk Int64, + wr_refunded_cdemo_sk Int64, + wr_refunded_hdemo_sk Int64, + wr_refunded_addr_sk Int64, + wr_returning_customer_sk Int64, + wr_returning_cdemo_sk Int64, + wr_returning_hdemo_sk Int64, + wr_returning_addr_sk Int64, + wr_web_page_sk Int64, + wr_reason_sk Int64, + wr_order_number Int64 NOT NULL, + wr_return_quantity Int64, + wr_return_amt Decimal(22,9), + wr_return_tax Decimal(22,9), + wr_return_amt_inc_tax Decimal(22,9), + wr_fee Decimal(22,9), + wr_return_ship_cost Decimal(22,9), + wr_refunded_cash Decimal(22,9), + wr_reversed_charge Decimal(22,9), + wr_account_credit Decimal(22,9), + wr_net_loss Decimal(22,9), + PRIMARY KEY (wr_item_sk, wr_order_number) ) -PARTITION BY HASH(wr_item_sk, wr_order_number) +PARTITION BY HASH (wr_item_sk, wr_order_number) WITH ( -STORE = COLUMN, --"/web_returns/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/web_sales` -( - ws_sold_date_sk Int64 , - ws_sold_time_sk Int64 , - ws_ship_date_sk Int64 , - ws_item_sk Int64 NOT NULL, - ws_bill_customer_sk Int64 , - ws_bill_cdemo_sk Int64 , - ws_bill_hdemo_sk Int64 , - ws_bill_addr_sk Int64 , - ws_ship_customer_sk Int64 , - ws_ship_cdemo_sk Int64 , - ws_ship_hdemo_sk Int64 , - ws_ship_addr_sk Int64 , - ws_web_page_sk Int64 , - ws_web_site_sk Int64 , - ws_ship_mode_sk Int64 , - ws_warehouse_sk Int64 , - ws_promo_sk Int64 , - ws_order_number Int64 NOT NULL, - ws_quantity Int64 , - ws_wholesale_cost Decimal(22,9), - ws_list_price Decimal(22,9), - ws_sales_price Decimal(22,9), - ws_ext_discount_amt Decimal(22,9), - ws_ext_sales_price Decimal(22,9), - ws_ext_wholesale_cost Decimal(22,9), - ws_ext_list_price Decimal(22,9), - ws_ext_tax Decimal(22,9), - ws_coupon_amt Decimal(22,9), - ws_ext_ship_cost Decimal(22,9), - ws_net_paid Decimal(22,9), - ws_net_paid_inc_tax Decimal(22,9), - ws_net_paid_inc_ship Decimal(22,9), - ws_net_paid_inc_ship_tax Decimal(22,9), - ws_net_profit Decimal(22,9) - , PRIMARY KEY (ws_item_sk, ws_order_number) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/web_sales` ( + ws_sold_date_sk Int64, + ws_sold_time_sk Int64, + ws_ship_date_sk Int64, + ws_item_sk Int64 NOT NULL, + ws_bill_customer_sk Int64, + ws_bill_cdemo_sk Int64, + ws_bill_hdemo_sk Int64, + ws_bill_addr_sk Int64, + ws_ship_customer_sk Int64, + ws_ship_cdemo_sk Int64, + ws_ship_hdemo_sk Int64, + ws_ship_addr_sk Int64, + ws_web_page_sk Int64, + ws_web_site_sk Int64, + ws_ship_mode_sk Int64, + ws_warehouse_sk Int64, + ws_promo_sk Int64, + ws_order_number Int64 NOT NULL, + ws_quantity Int64, + ws_wholesale_cost Decimal(22,9), + ws_list_price Decimal(22,9), + ws_sales_price Decimal(22,9), + ws_ext_discount_amt Decimal(22,9), + ws_ext_sales_price Decimal(22,9), + ws_ext_wholesale_cost Decimal(22,9), + ws_ext_list_price Decimal(22,9), + ws_ext_tax Decimal(22,9), + ws_coupon_amt Decimal(22,9), + ws_ext_ship_cost Decimal(22,9), + ws_net_paid Decimal(22,9), + ws_net_paid_inc_tax Decimal(22,9), + ws_net_paid_inc_ship Decimal(22,9), + ws_net_paid_inc_ship_tax Decimal(22,9), + ws_net_profit Decimal(22,9), + PRIMARY KEY (ws_item_sk, ws_order_number) ) -PARTITION BY HASH(ws_item_sk, ws_order_number) +PARTITION BY HASH (ws_item_sk, ws_order_number) WITH ( -STORE = COLUMN, --"/web_sales/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/catalog_sales` -( - cs_sold_date_sk Int64 , - cs_sold_time_sk Int64 , - cs_ship_date_sk Int64 , - cs_bill_customer_sk Int64 , - cs_bill_cdemo_sk Int64 , - cs_bill_hdemo_sk Int64 , - cs_bill_addr_sk Int64 , - cs_ship_customer_sk Int64 , - cs_ship_cdemo_sk Int64 , - cs_ship_hdemo_sk Int64 , - cs_ship_addr_sk Int64 , - cs_call_center_sk Int64 , - cs_catalog_page_sk Int64 , - cs_ship_mode_sk Int64 , - cs_warehouse_sk Int64 , - cs_item_sk Int64 NOT NULL, - cs_promo_sk Int64 , - cs_order_number Int64 NOT NULL, - cs_quantity Int64 , - cs_wholesale_cost Decimal(22,9), - cs_list_price Decimal(22,9), - cs_sales_price Decimal(22,9), - cs_ext_discount_amt Decimal(22,9), - cs_ext_sales_price Decimal(22,9), - cs_ext_wholesale_cost Decimal(22,9), - cs_ext_list_price Decimal(22,9), - cs_ext_tax Decimal(22,9), - cs_coupon_amt Decimal(22,9), - cs_ext_ship_cost Decimal(22,9), - cs_net_paid Decimal(22,9), - cs_net_paid_inc_tax Decimal(22,9), - cs_net_paid_inc_ship Decimal(22,9), - cs_net_paid_inc_ship_tax Decimal(22,9), - cs_net_profit Decimal(22,9) - , PRIMARY KEY (cs_item_sk, cs_order_number) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/catalog_sales` ( + cs_sold_date_sk Int64, + cs_sold_time_sk Int64, + cs_ship_date_sk Int64, + cs_bill_customer_sk Int64, + cs_bill_cdemo_sk Int64, + cs_bill_hdemo_sk Int64, + cs_bill_addr_sk Int64, + cs_ship_customer_sk Int64, + cs_ship_cdemo_sk Int64, + cs_ship_hdemo_sk Int64, + cs_ship_addr_sk Int64, + cs_call_center_sk Int64, + cs_catalog_page_sk Int64, + cs_ship_mode_sk Int64, + cs_warehouse_sk Int64, + cs_item_sk Int64 NOT NULL, + cs_promo_sk Int64, + cs_order_number Int64 NOT NULL, + cs_quantity Int64, + cs_wholesale_cost Decimal(22,9), + cs_list_price Decimal(22,9), + cs_sales_price Decimal(22,9), + cs_ext_discount_amt Decimal(22,9), + cs_ext_sales_price Decimal(22,9), + cs_ext_wholesale_cost Decimal(22,9), + cs_ext_list_price Decimal(22,9), + cs_ext_tax Decimal(22,9), + cs_coupon_amt Decimal(22,9), + cs_ext_ship_cost Decimal(22,9), + cs_net_paid Decimal(22,9), + cs_net_paid_inc_tax Decimal(22,9), + cs_net_paid_inc_ship Decimal(22,9), + cs_net_paid_inc_ship_tax Decimal(22,9), + cs_net_profit Decimal(22,9), + PRIMARY KEY (cs_item_sk, cs_order_number) ) -PARTITION BY HASH(cs_item_sk, cs_order_number) +PARTITION BY HASH (cs_item_sk, cs_order_number) WITH ( -STORE = COLUMN, --"/catalog_sales/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/store_sales` -( - ss_sold_date_sk Int64 , - ss_sold_time_sk Int64 , - ss_item_sk Int64 NOT NULL, - ss_customer_sk Int64 , - ss_cdemo_sk Int64 , - ss_hdemo_sk Int64 , - ss_addr_sk Int64 , - ss_store_sk Int64 , - ss_promo_sk Int64 , - ss_ticket_number Int64 NOT NULL, - ss_quantity Int64 , - ss_wholesale_cost Decimal(22,9), - ss_list_price Decimal(22,9), - ss_sales_price Decimal(22,9), - ss_ext_discount_amt Decimal(22,9), - ss_ext_sales_price Decimal(22,9), - ss_ext_wholesale_cost Decimal(22,9), - ss_ext_list_price Decimal(22,9), - ss_ext_tax Decimal(22,9), - ss_coupon_amt Decimal(22,9), - ss_net_paid Decimal(22,9), - ss_net_paid_inc_tax Decimal(22,9), - ss_net_profit Decimal(22,9) - , PRIMARY KEY (ss_item_sk, ss_ticket_number) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/store_sales` ( + ss_sold_date_sk Int64, + ss_sold_time_sk Int64, + ss_item_sk Int64 NOT NULL, + ss_customer_sk Int64, + ss_cdemo_sk Int64, + ss_hdemo_sk Int64, + ss_addr_sk Int64, + ss_store_sk Int64, + ss_promo_sk Int64, + ss_ticket_number Int64 NOT NULL, + ss_quantity Int64, + ss_wholesale_cost Decimal(22,9), + ss_list_price Decimal(22,9), + ss_sales_price Decimal(22,9), + ss_ext_discount_amt Decimal(22,9), + ss_ext_sales_price Decimal(22,9), + ss_ext_wholesale_cost Decimal(22,9), + ss_ext_list_price Decimal(22,9), + ss_ext_tax Decimal(22,9), + ss_coupon_amt Decimal(22,9), + ss_net_paid Decimal(22,9), + ss_net_paid_inc_tax Decimal(22,9), + ss_net_profit Decimal(22,9), + PRIMARY KEY (ss_item_sk, ss_ticket_number) ) -PARTITION BY HASH(ss_item_sk, ss_ticket_number) +PARTITION BY HASH (ss_item_sk, ss_ticket_number) WITH ( -STORE = COLUMN, --"/store_sales/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); Init tables ...Ok diff --git a/ydb/tests/functional/tpc/canondata/test_init.TestTpcdsInit.test_s1_row/s1_row b/ydb/tests/functional/tpc/canondata/test_init.TestTpcdsInit.test_s1_row/s1_row index ea025e7aec1c..e20e3f4b40e2 100644 --- a/ydb/tests/functional/tpc/canondata/test_init.TestTpcdsInit.test_s1_row/s1_row +++ b/ydb/tests/functional/tpc/canondata/test_init.TestTpcdsInit.test_s1_row/s1_row @@ -1,669 +1,597 @@ Init tables ... +--!syntax_v1 - -CREATE TABLE `/Root/db/Root/db/tpcds/s1/customer_address` -( - ca_address_sk Int64 , - ca_address_id Utf8, - ca_street_number Utf8, - ca_street_name Utf8, - ca_street_type Utf8, - ca_suite_number Utf8, - ca_city Utf8, - ca_county Utf8, - ca_state Utf8, - ca_zip Utf8, - ca_country Utf8, - ca_gmt_offset Double , - ca_location_type Utf8 - , PRIMARY KEY (ca_address_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/customer_address` ( + ca_address_sk Int64, + ca_address_id Utf8, + ca_street_number Utf8, + ca_street_name Utf8, + ca_street_type Utf8, + ca_suite_number Utf8, + ca_city Utf8, + ca_county Utf8, + ca_state Utf8, + ca_zip Utf8, + ca_country Utf8, + ca_gmt_offset Double, + ca_location_type Utf8, + PRIMARY KEY (ca_address_sk) ) --- (ca_address_sk) WITH ( --- "/customer_address/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/customer_demographics` -( - cd_demo_sk Int64 , - cd_gender Utf8, - cd_marital_status Utf8, - cd_education_status Utf8, - cd_purchase_estimate Int64 , - cd_credit_rating Utf8, - cd_dep_count Int64 , - cd_dep_employed_count Int64 , - cd_dep_college_count Int64 - , PRIMARY KEY (cd_demo_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/customer_demographics` ( + cd_demo_sk Int64, + cd_gender Utf8, + cd_marital_status Utf8, + cd_education_status Utf8, + cd_purchase_estimate Int64, + cd_credit_rating Utf8, + cd_dep_count Int64, + cd_dep_employed_count Int64, + cd_dep_college_count Int64, + PRIMARY KEY (cd_demo_sk) ) --- (cd_demo_sk) WITH ( --- "/customer_demographics/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/date_dim` -( - d_date_sk Int64 , - d_date_id Utf8, - d_date Utf8, - d_month_seq Int64 , - d_week_seq Int64 , - d_quarter_seq Int64 , - d_year Int64 , - d_dow Int64 , - d_moy Int64 , - d_dom Int64 , - d_qoy Int64 , - d_fy_year Int64 , - d_fy_quarter_seq Int64 , - d_fy_week_seq Int64 , - d_day_name Utf8, - d_quarter_name Utf8, - d_holiday Utf8, - d_weekend Utf8, - d_following_holiday Utf8, - d_first_dom Int64 , - d_last_dom Int64 , - d_same_day_ly Int64 , - d_same_day_lq Int64 , - d_current_day Utf8, - d_current_week Utf8, - d_current_month Utf8, - d_current_quarter Utf8, - d_current_year Utf8 - , PRIMARY KEY (d_date_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/date_dim` ( + d_date_sk Int64, + d_date_id Utf8, + d_date Utf8, + d_month_seq Int64, + d_week_seq Int64, + d_quarter_seq Int64, + d_year Int64, + d_dow Int64, + d_moy Int64, + d_dom Int64, + d_qoy Int64, + d_fy_year Int64, + d_fy_quarter_seq Int64, + d_fy_week_seq Int64, + d_day_name Utf8, + d_quarter_name Utf8, + d_holiday Utf8, + d_weekend Utf8, + d_following_holiday Utf8, + d_first_dom Int64, + d_last_dom Int64, + d_same_day_ly Int64, + d_same_day_lq Int64, + d_current_day Utf8, + d_current_week Utf8, + d_current_month Utf8, + d_current_quarter Utf8, + d_current_year Utf8, + PRIMARY KEY (d_date_sk) ) --- (d_date_sk) WITH ( --- "/date_dim/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/warehouse` -( - w_warehouse_sk Int64 , - w_warehouse_id Utf8, - w_warehouse_name Utf8, - w_warehouse_sq_ft Int64 , - w_street_number Utf8, - w_street_name Utf8, - w_street_type Utf8, - w_suite_number Utf8, - w_city Utf8, - w_county Utf8, - w_state Utf8, - w_zip Utf8, - w_country Utf8, - w_gmt_offset Double - , PRIMARY KEY (w_warehouse_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/warehouse` ( + w_warehouse_sk Int64, + w_warehouse_id Utf8, + w_warehouse_name Utf8, + w_warehouse_sq_ft Int64, + w_street_number Utf8, + w_street_name Utf8, + w_street_type Utf8, + w_suite_number Utf8, + w_city Utf8, + w_county Utf8, + w_state Utf8, + w_zip Utf8, + w_country Utf8, + w_gmt_offset Double, + PRIMARY KEY (w_warehouse_sk) ) --- (w_warehouse_sk) WITH ( --- "/warehouse/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/ship_mode` -( - sm_ship_mode_sk Int64 , - sm_ship_mode_id Utf8, - sm_type Utf8, - sm_code Utf8, - sm_carrier Utf8, - sm_contract Utf8 - , PRIMARY KEY (sm_ship_mode_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/ship_mode` ( + sm_ship_mode_sk Int64, + sm_ship_mode_id Utf8, + sm_type Utf8, + sm_code Utf8, + sm_carrier Utf8, + sm_contract Utf8, + PRIMARY KEY (sm_ship_mode_sk) ) --- (sm_ship_mode_sk) WITH ( --- "/ship_mode/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/time_dim` -( - t_time_sk Int64 , - t_time_id Utf8, - t_time Int64 , - t_hour Int64 , - t_minute Int64 , - t_second Int64 , - t_am_pm Utf8, - t_shift Utf8, - t_sub_shift Utf8, - t_meal_time Utf8 - , PRIMARY KEY (t_time_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/time_dim` ( + t_time_sk Int64, + t_time_id Utf8, + t_time Int64, + t_hour Int64, + t_minute Int64, + t_second Int64, + t_am_pm Utf8, + t_shift Utf8, + t_sub_shift Utf8, + t_meal_time Utf8, + PRIMARY KEY (t_time_sk) ) --- (t_time_sk) WITH ( --- "/time_dim/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/reason` -( - r_reason_sk Int64 , - r_reason_id Utf8, - r_reason_desc Utf8 - , PRIMARY KEY (r_reason_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/reason` ( + r_reason_sk Int64, + r_reason_id Utf8, + r_reason_desc Utf8, + PRIMARY KEY (r_reason_sk) ) --- (r_reason_sk) WITH ( --- "/reason/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/income_band` -( - ib_income_band_sk Int64 , - ib_lower_bound Int64 , - ib_upper_bound Int64 - , PRIMARY KEY (ib_income_band_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/income_band` ( + ib_income_band_sk Int64, + ib_lower_bound Int64, + ib_upper_bound Int64, + PRIMARY KEY (ib_income_band_sk) ) --- (ib_income_band_sk) WITH ( --- "/income_band/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/item` -( - i_item_sk Int64 , - i_item_id Utf8, - i_rec_start_date Date32 , - i_rec_end_date Date32 , - i_item_desc Utf8, - i_current_price Double, - i_wholesale_cost Double, - i_brand_id Int64 , - i_brand Utf8, - i_class_id Int64 , - i_class Utf8, - i_category_id Int64 , - i_category Utf8, - i_manufact_id Int64 , - i_manufact Utf8, - i_size Utf8, - i_formulation Utf8, - i_color Utf8, - i_units Utf8, - i_container Utf8, - i_manager_id Int64 , - i_product_name Utf8 - , PRIMARY KEY (i_item_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/item` ( + i_item_sk Int64, + i_item_id Utf8, + i_rec_start_date Date32, + i_rec_end_date Date32, + i_item_desc Utf8, + i_current_price Double, + i_wholesale_cost Double, + i_brand_id Int64, + i_brand Utf8, + i_class_id Int64, + i_class Utf8, + i_category_id Int64, + i_category Utf8, + i_manufact_id Int64, + i_manufact Utf8, + i_size Utf8, + i_formulation Utf8, + i_color Utf8, + i_units Utf8, + i_container Utf8, + i_manager_id Int64, + i_product_name Utf8, + PRIMARY KEY (i_item_sk) ) --- (i_item_sk) WITH ( --- "/item/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/store` -( - s_store_sk Int64 , - s_store_id Utf8, - s_rec_start_date Date32 , - s_rec_end_date Date32 , - s_closed_date_sk Int64 , - s_store_name Utf8, - s_number_employees Int64 , - s_floor_space Int64 , - s_hours Utf8, - s_manager Utf8, - s_market_id Int64 , - s_geography_class Utf8, - s_market_desc Utf8, - s_market_manager Utf8, - s_division_id Int64 , - s_division_name Utf8, - s_company_id Int64 , - s_company_name Utf8, - s_street_number Utf8, - s_street_name Utf8, - s_street_type Utf8, - s_suite_number Utf8, - s_city Utf8, - s_county Utf8, - s_state Utf8, - s_zip Utf8, - s_country Utf8, - s_gmt_offset Double, - s_tax_precentage Double - , PRIMARY KEY (s_store_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/store` ( + s_store_sk Int64, + s_store_id Utf8, + s_rec_start_date Date32, + s_rec_end_date Date32, + s_closed_date_sk Int64, + s_store_name Utf8, + s_number_employees Int64, + s_floor_space Int64, + s_hours Utf8, + s_manager Utf8, + s_market_id Int64, + s_geography_class Utf8, + s_market_desc Utf8, + s_market_manager Utf8, + s_division_id Int64, + s_division_name Utf8, + s_company_id Int64, + s_company_name Utf8, + s_street_number Utf8, + s_street_name Utf8, + s_street_type Utf8, + s_suite_number Utf8, + s_city Utf8, + s_county Utf8, + s_state Utf8, + s_zip Utf8, + s_country Utf8, + s_gmt_offset Double, + s_tax_precentage Double, + PRIMARY KEY (s_store_sk) ) --- (s_store_sk) WITH ( --- "/store/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/call_center` -( - cc_call_center_sk Int64 , - cc_call_center_id Utf8, - cc_rec_start_date Date32 , - cc_rec_end_date Date32 , - cc_closed_date_sk Int64 , - cc_open_date_sk Int64 , - cc_name Utf8, - cc_class Utf8, - cc_employees Int64 , - cc_sq_ft Int64 , - cc_hours Utf8, - cc_manager Utf8, - cc_mkt_id Int64 , - cc_mkt_class Utf8, - cc_mkt_desc Utf8, - cc_market_manager Utf8, - cc_division Int64 , - cc_division_name Utf8, - cc_company Int64 , - cc_company_name Utf8, - cc_street_number Utf8, - cc_street_name Utf8, - cc_street_type Utf8, - cc_suite_number Utf8, - cc_city Utf8, - cc_county Utf8, - cc_state Utf8, - cc_zip Utf8, - cc_country Utf8, - cc_gmt_offset Double, - cc_tax_percentage Double - , PRIMARY KEY (cc_call_center_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/call_center` ( + cc_call_center_sk Int64, + cc_call_center_id Utf8, + cc_rec_start_date Date32, + cc_rec_end_date Date32, + cc_closed_date_sk Int64, + cc_open_date_sk Int64, + cc_name Utf8, + cc_class Utf8, + cc_employees Int64, + cc_sq_ft Int64, + cc_hours Utf8, + cc_manager Utf8, + cc_mkt_id Int64, + cc_mkt_class Utf8, + cc_mkt_desc Utf8, + cc_market_manager Utf8, + cc_division Int64, + cc_division_name Utf8, + cc_company Int64, + cc_company_name Utf8, + cc_street_number Utf8, + cc_street_name Utf8, + cc_street_type Utf8, + cc_suite_number Utf8, + cc_city Utf8, + cc_county Utf8, + cc_state Utf8, + cc_zip Utf8, + cc_country Utf8, + cc_gmt_offset Double, + cc_tax_percentage Double, + PRIMARY KEY (cc_call_center_sk) ) --- (cc_call_center_sk) WITH ( --- "/call_center/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/customer` -( - c_customer_sk Int64 , - c_customer_id Utf8, - c_current_cdemo_sk Int64 , - c_current_hdemo_sk Int64 , - c_current_addr_sk Int64 , - c_first_shipto_date_sk Int64 , - c_first_sales_date_sk Int64 , - c_salutation Utf8, - c_first_name Utf8, - c_last_name Utf8, - c_preferred_cust_flag Utf8, - c_birth_day Int64 , - c_birth_month Int64 , - c_birth_year Int64 , - c_birth_country Utf8, - c_login Utf8, - c_email_address Utf8, - c_last_review_date Utf8 - , PRIMARY KEY (c_customer_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/customer` ( + c_customer_sk Int64, + c_customer_id Utf8, + c_current_cdemo_sk Int64, + c_current_hdemo_sk Int64, + c_current_addr_sk Int64, + c_first_shipto_date_sk Int64, + c_first_sales_date_sk Int64, + c_salutation Utf8, + c_first_name Utf8, + c_last_name Utf8, + c_preferred_cust_flag Utf8, + c_birth_day Int64, + c_birth_month Int64, + c_birth_year Int64, + c_birth_country Utf8, + c_login Utf8, + c_email_address Utf8, + c_last_review_date Utf8, + PRIMARY KEY (c_customer_sk) ) --- (c_customer_sk) WITH ( --- "/customer/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/web_site` -( - web_site_sk Int64 , - web_site_id Utf8, - web_rec_start_date Date32 , - web_rec_end_date Date32 , - web_name Utf8, - web_open_date_sk Int64 , - web_close_date_sk Int64 , - web_class Utf8, - web_manager Utf8, - web_mkt_id Int64 , - web_mkt_class Utf8, - web_mkt_desc Utf8, - web_market_manager Utf8, - web_company_id Int64 , - web_company_name Utf8, - web_street_number Utf8, - web_street_name Utf8, - web_street_type Utf8, - web_suite_number Utf8, - web_city Utf8, - web_county Utf8, - web_state Utf8, - web_zip Utf8, - web_country Utf8, - web_gmt_offset Double, - web_tax_percentage Double - , PRIMARY KEY (web_site_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/web_site` ( + web_site_sk Int64, + web_site_id Utf8, + web_rec_start_date Date32, + web_rec_end_date Date32, + web_name Utf8, + web_open_date_sk Int64, + web_close_date_sk Int64, + web_class Utf8, + web_manager Utf8, + web_mkt_id Int64, + web_mkt_class Utf8, + web_mkt_desc Utf8, + web_market_manager Utf8, + web_company_id Int64, + web_company_name Utf8, + web_street_number Utf8, + web_street_name Utf8, + web_street_type Utf8, + web_suite_number Utf8, + web_city Utf8, + web_county Utf8, + web_state Utf8, + web_zip Utf8, + web_country Utf8, + web_gmt_offset Double, + web_tax_percentage Double, + PRIMARY KEY (web_site_sk) ) --- (web_site_sk) WITH ( --- "/web_site/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/store_returns` -( - sr_returned_date_sk Int64 , - sr_return_time_sk Int64 , - sr_item_sk Int64 , - sr_customer_sk Int64 , - sr_cdemo_sk Int64 , - sr_hdemo_sk Int64 , - sr_addr_sk Int64 , - sr_store_sk Int64 , - sr_reason_sk Int64 , - sr_ticket_number Int64 , - sr_return_quantity Int64 , - sr_return_amt Double, - sr_return_tax Double, - sr_return_amt_inc_tax Double, - sr_fee Double, - sr_return_ship_cost Double, - sr_refunded_cash Double, - sr_reversed_charge Double, - sr_store_credit Double, - sr_net_loss Double - , PRIMARY KEY (sr_item_sk, sr_ticket_number) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/store_returns` ( + sr_returned_date_sk Int64, + sr_return_time_sk Int64, + sr_item_sk Int64, + sr_customer_sk Int64, + sr_cdemo_sk Int64, + sr_hdemo_sk Int64, + sr_addr_sk Int64, + sr_store_sk Int64, + sr_reason_sk Int64, + sr_ticket_number Int64, + sr_return_quantity Int64, + sr_return_amt Double, + sr_return_tax Double, + sr_return_amt_inc_tax Double, + sr_fee Double, + sr_return_ship_cost Double, + sr_refunded_cash Double, + sr_reversed_charge Double, + sr_store_credit Double, + sr_net_loss Double, + PRIMARY KEY (sr_item_sk, sr_ticket_number) ) --- (sr_item_sk, sr_ticket_number) WITH ( --- "/store_returns/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/household_demographics` -( - hd_demo_sk Int64 , - hd_income_band_sk Int64 , - hd_buy_potential Utf8, - hd_dep_count Int64 , - hd_vehicle_count Int64 - , PRIMARY KEY (hd_demo_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/household_demographics` ( + hd_demo_sk Int64, + hd_income_band_sk Int64, + hd_buy_potential Utf8, + hd_dep_count Int64, + hd_vehicle_count Int64, + PRIMARY KEY (hd_demo_sk) ) --- (hd_demo_sk) WITH ( --- "/household_demographics/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/web_page` -( - wp_web_page_sk Int64 , - wp_web_page_id Utf8, - wp_rec_start_date Date32 , - wp_rec_end_date Date32 , - wp_creation_date_sk Int64 , - wp_access_date_sk Int64 , - wp_autogen_flag Utf8, - wp_customer_sk Int64 , - wp_url Utf8, - wp_type Utf8, - wp_char_count Int64 , - wp_link_count Int64 , - wp_image_count Int64 , - wp_max_ad_count Int64 - , PRIMARY KEY (wp_web_page_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/web_page` ( + wp_web_page_sk Int64, + wp_web_page_id Utf8, + wp_rec_start_date Date32, + wp_rec_end_date Date32, + wp_creation_date_sk Int64, + wp_access_date_sk Int64, + wp_autogen_flag Utf8, + wp_customer_sk Int64, + wp_url Utf8, + wp_type Utf8, + wp_char_count Int64, + wp_link_count Int64, + wp_image_count Int64, + wp_max_ad_count Int64, + PRIMARY KEY (wp_web_page_sk) ) --- (wp_web_page_sk) WITH ( --- "/web_page/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/promotion` -( - p_promo_sk Int64 , - p_promo_id Utf8, - p_start_date_sk Int64 , - p_end_date_sk Int64 , - p_item_sk Int64 , - p_cost Double, - p_response_target Int64 , - p_promo_name Utf8, - p_channel_dmail Utf8, - p_channel_email Utf8, - p_channel_catalog Utf8, - p_channel_tv Utf8, - p_channel_radio Utf8, - p_channel_press Utf8, - p_channel_event Utf8, - p_channel_demo Utf8, - p_channel_details Utf8, - p_purpose Utf8, - p_discount_active Utf8 - , PRIMARY KEY (p_promo_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/promotion` ( + p_promo_sk Int64, + p_promo_id Utf8, + p_start_date_sk Int64, + p_end_date_sk Int64, + p_item_sk Int64, + p_cost Double, + p_response_target Int64, + p_promo_name Utf8, + p_channel_dmail Utf8, + p_channel_email Utf8, + p_channel_catalog Utf8, + p_channel_tv Utf8, + p_channel_radio Utf8, + p_channel_press Utf8, + p_channel_event Utf8, + p_channel_demo Utf8, + p_channel_details Utf8, + p_purpose Utf8, + p_discount_active Utf8, + PRIMARY KEY (p_promo_sk) ) --- (p_promo_sk) WITH ( --- "/promotion/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/catalog_page` -( - cp_catalog_page_sk Int64 , - cp_catalog_page_id Utf8, - cp_start_date_sk Int64 , - cp_end_date_sk Int64 , - cp_department Utf8, - cp_catalog_number Int64 , - cp_catalog_page_number Int64 , - cp_description Utf8, - cp_type Utf8 - , PRIMARY KEY (cp_catalog_page_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/catalog_page` ( + cp_catalog_page_sk Int64, + cp_catalog_page_id Utf8, + cp_start_date_sk Int64, + cp_end_date_sk Int64, + cp_department Utf8, + cp_catalog_number Int64, + cp_catalog_page_number Int64, + cp_description Utf8, + cp_type Utf8, + PRIMARY KEY (cp_catalog_page_sk) ) --- (cp_catalog_page_sk) WITH ( --- "/catalog_page/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/inventory` -( - inv_date_sk Int64 , - inv_item_sk Int64 , - inv_warehouse_sk Int64 , - inv_quantity_on_hand Int64 - , PRIMARY KEY (inv_date_sk, inv_item_sk, inv_warehouse_sk) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/inventory` ( + inv_date_sk Int64, + inv_item_sk Int64, + inv_warehouse_sk Int64, + inv_quantity_on_hand Int64, + PRIMARY KEY (inv_date_sk, inv_item_sk, inv_warehouse_sk) ) --- (inv_date_sk, inv_item_sk, inv_warehouse_sk) WITH ( --- "/inventory/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/catalog_returns` -( - cr_returned_date_sk Int64 , - cr_returned_time_sk Int64 , - cr_item_sk Int64 , - cr_refunded_customer_sk Int64 , - cr_refunded_cdemo_sk Int64 , - cr_refunded_hdemo_sk Int64 , - cr_refunded_addr_sk Int64 , - cr_returning_customer_sk Int64 , - cr_returning_cdemo_sk Int64 , - cr_returning_hdemo_sk Int64 , - cr_returning_addr_sk Int64 , - cr_call_center_sk Int64 , - cr_catalog_page_sk Int64 , - cr_ship_mode_sk Int64 , - cr_warehouse_sk Int64 , - cr_reason_sk Int64 , - cr_order_number Int64 , - cr_return_quantity Int64 , - cr_return_amount Double, - cr_return_tax Double, - cr_return_amt_inc_tax Double, - cr_fee Double, - cr_return_ship_cost Double, - cr_refunded_cash Double, - cr_reversed_charge Double, - cr_store_credit Double, - cr_net_loss Double - , PRIMARY KEY (cr_item_sk, cr_order_number) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/catalog_returns` ( + cr_returned_date_sk Int64, + cr_returned_time_sk Int64, + cr_item_sk Int64, + cr_refunded_customer_sk Int64, + cr_refunded_cdemo_sk Int64, + cr_refunded_hdemo_sk Int64, + cr_refunded_addr_sk Int64, + cr_returning_customer_sk Int64, + cr_returning_cdemo_sk Int64, + cr_returning_hdemo_sk Int64, + cr_returning_addr_sk Int64, + cr_call_center_sk Int64, + cr_catalog_page_sk Int64, + cr_ship_mode_sk Int64, + cr_warehouse_sk Int64, + cr_reason_sk Int64, + cr_order_number Int64, + cr_return_quantity Int64, + cr_return_amount Double, + cr_return_tax Double, + cr_return_amt_inc_tax Double, + cr_fee Double, + cr_return_ship_cost Double, + cr_refunded_cash Double, + cr_reversed_charge Double, + cr_store_credit Double, + cr_net_loss Double, + PRIMARY KEY (cr_item_sk, cr_order_number) ) --- (cr_item_sk, cr_order_number) WITH ( --- "/catalog_returns/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/web_returns` -( - wr_returned_date_sk Int64 , - wr_returned_time_sk Int64 , - wr_item_sk Int64 , - wr_refunded_customer_sk Int64 , - wr_refunded_cdemo_sk Int64 , - wr_refunded_hdemo_sk Int64 , - wr_refunded_addr_sk Int64 , - wr_returning_customer_sk Int64 , - wr_returning_cdemo_sk Int64 , - wr_returning_hdemo_sk Int64 , - wr_returning_addr_sk Int64 , - wr_web_page_sk Int64 , - wr_reason_sk Int64 , - wr_order_number Int64 , - wr_return_quantity Int64 , - wr_return_amt Double, - wr_return_tax Double, - wr_return_amt_inc_tax Double, - wr_fee Double, - wr_return_ship_cost Double, - wr_refunded_cash Double, - wr_reversed_charge Double, - wr_account_credit Double, - wr_net_loss Double - , PRIMARY KEY (wr_item_sk, wr_order_number) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/web_returns` ( + wr_returned_date_sk Int64, + wr_returned_time_sk Int64, + wr_item_sk Int64, + wr_refunded_customer_sk Int64, + wr_refunded_cdemo_sk Int64, + wr_refunded_hdemo_sk Int64, + wr_refunded_addr_sk Int64, + wr_returning_customer_sk Int64, + wr_returning_cdemo_sk Int64, + wr_returning_hdemo_sk Int64, + wr_returning_addr_sk Int64, + wr_web_page_sk Int64, + wr_reason_sk Int64, + wr_order_number Int64, + wr_return_quantity Int64, + wr_return_amt Double, + wr_return_tax Double, + wr_return_amt_inc_tax Double, + wr_fee Double, + wr_return_ship_cost Double, + wr_refunded_cash Double, + wr_reversed_charge Double, + wr_account_credit Double, + wr_net_loss Double, + PRIMARY KEY (wr_item_sk, wr_order_number) ) --- (wr_item_sk, wr_order_number) WITH ( --- "/web_returns/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/web_sales` -( - ws_sold_date_sk Int64 , - ws_sold_time_sk Int64 , - ws_ship_date_sk Int64 , - ws_item_sk Int64 , - ws_bill_customer_sk Int64 , - ws_bill_cdemo_sk Int64 , - ws_bill_hdemo_sk Int64 , - ws_bill_addr_sk Int64 , - ws_ship_customer_sk Int64 , - ws_ship_cdemo_sk Int64 , - ws_ship_hdemo_sk Int64 , - ws_ship_addr_sk Int64 , - ws_web_page_sk Int64 , - ws_web_site_sk Int64 , - ws_ship_mode_sk Int64 , - ws_warehouse_sk Int64 , - ws_promo_sk Int64 , - ws_order_number Int64 , - ws_quantity Int64 , - ws_wholesale_cost Double, - ws_list_price Double, - ws_sales_price Double, - ws_ext_discount_amt Double, - ws_ext_sales_price Double, - ws_ext_wholesale_cost Double, - ws_ext_list_price Double, - ws_ext_tax Double, - ws_coupon_amt Double, - ws_ext_ship_cost Double, - ws_net_paid Double, - ws_net_paid_inc_tax Double, - ws_net_paid_inc_ship Double, - ws_net_paid_inc_ship_tax Double, - ws_net_profit Double - , PRIMARY KEY (ws_item_sk, ws_order_number) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/web_sales` ( + ws_sold_date_sk Int64, + ws_sold_time_sk Int64, + ws_ship_date_sk Int64, + ws_item_sk Int64, + ws_bill_customer_sk Int64, + ws_bill_cdemo_sk Int64, + ws_bill_hdemo_sk Int64, + ws_bill_addr_sk Int64, + ws_ship_customer_sk Int64, + ws_ship_cdemo_sk Int64, + ws_ship_hdemo_sk Int64, + ws_ship_addr_sk Int64, + ws_web_page_sk Int64, + ws_web_site_sk Int64, + ws_ship_mode_sk Int64, + ws_warehouse_sk Int64, + ws_promo_sk Int64, + ws_order_number Int64, + ws_quantity Int64, + ws_wholesale_cost Double, + ws_list_price Double, + ws_sales_price Double, + ws_ext_discount_amt Double, + ws_ext_sales_price Double, + ws_ext_wholesale_cost Double, + ws_ext_list_price Double, + ws_ext_tax Double, + ws_coupon_amt Double, + ws_ext_ship_cost Double, + ws_net_paid Double, + ws_net_paid_inc_tax Double, + ws_net_paid_inc_ship Double, + ws_net_paid_inc_ship_tax Double, + ws_net_profit Double, + PRIMARY KEY (ws_item_sk, ws_order_number) ) --- (ws_item_sk, ws_order_number) WITH ( --- "/web_sales/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/catalog_sales` -( - cs_sold_date_sk Int64 , - cs_sold_time_sk Int64 , - cs_ship_date_sk Int64 , - cs_bill_customer_sk Int64 , - cs_bill_cdemo_sk Int64 , - cs_bill_hdemo_sk Int64 , - cs_bill_addr_sk Int64 , - cs_ship_customer_sk Int64 , - cs_ship_cdemo_sk Int64 , - cs_ship_hdemo_sk Int64 , - cs_ship_addr_sk Int64 , - cs_call_center_sk Int64 , - cs_catalog_page_sk Int64 , - cs_ship_mode_sk Int64 , - cs_warehouse_sk Int64 , - cs_item_sk Int64 , - cs_promo_sk Int64 , - cs_order_number Int64 , - cs_quantity Int64 , - cs_wholesale_cost Double, - cs_list_price Double, - cs_sales_price Double, - cs_ext_discount_amt Double, - cs_ext_sales_price Double, - cs_ext_wholesale_cost Double, - cs_ext_list_price Double, - cs_ext_tax Double, - cs_coupon_amt Double, - cs_ext_ship_cost Double, - cs_net_paid Double, - cs_net_paid_inc_tax Double, - cs_net_paid_inc_ship Double, - cs_net_paid_inc_ship_tax Double, - cs_net_profit Double - , PRIMARY KEY (cs_item_sk, cs_order_number) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/catalog_sales` ( + cs_sold_date_sk Int64, + cs_sold_time_sk Int64, + cs_ship_date_sk Int64, + cs_bill_customer_sk Int64, + cs_bill_cdemo_sk Int64, + cs_bill_hdemo_sk Int64, + cs_bill_addr_sk Int64, + cs_ship_customer_sk Int64, + cs_ship_cdemo_sk Int64, + cs_ship_hdemo_sk Int64, + cs_ship_addr_sk Int64, + cs_call_center_sk Int64, + cs_catalog_page_sk Int64, + cs_ship_mode_sk Int64, + cs_warehouse_sk Int64, + cs_item_sk Int64, + cs_promo_sk Int64, + cs_order_number Int64, + cs_quantity Int64, + cs_wholesale_cost Double, + cs_list_price Double, + cs_sales_price Double, + cs_ext_discount_amt Double, + cs_ext_sales_price Double, + cs_ext_wholesale_cost Double, + cs_ext_list_price Double, + cs_ext_tax Double, + cs_coupon_amt Double, + cs_ext_ship_cost Double, + cs_net_paid Double, + cs_net_paid_inc_tax Double, + cs_net_paid_inc_ship Double, + cs_net_paid_inc_ship_tax Double, + cs_net_profit Double, + PRIMARY KEY (cs_item_sk, cs_order_number) ) --- (cs_item_sk, cs_order_number) WITH ( --- "/catalog_sales/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpcds/s1/store_sales` -( - ss_sold_date_sk Int64 , - ss_sold_time_sk Int64 , - ss_item_sk Int64 , - ss_customer_sk Int64 , - ss_cdemo_sk Int64 , - ss_hdemo_sk Int64 , - ss_addr_sk Int64 , - ss_store_sk Int64 , - ss_promo_sk Int64 , - ss_ticket_number Int64 , - ss_quantity Int64 , - ss_wholesale_cost Double, - ss_list_price Double, - ss_sales_price Double, - ss_ext_discount_amt Double, - ss_ext_sales_price Double, - ss_ext_wholesale_cost Double, - ss_ext_list_price Double, - ss_ext_tax Double, - ss_coupon_amt Double, - ss_net_paid Double, - ss_net_paid_inc_tax Double, - ss_net_profit Double - , PRIMARY KEY (ss_item_sk, ss_ticket_number) +CREATE TABLE `/Root/db/Root/db/tpcds/s1/store_sales` ( + ss_sold_date_sk Int64, + ss_sold_time_sk Int64, + ss_item_sk Int64, + ss_customer_sk Int64, + ss_cdemo_sk Int64, + ss_hdemo_sk Int64, + ss_addr_sk Int64, + ss_store_sk Int64, + ss_promo_sk Int64, + ss_ticket_number Int64, + ss_quantity Int64, + ss_wholesale_cost Double, + ss_list_price Double, + ss_sales_price Double, + ss_ext_discount_amt Double, + ss_ext_sales_price Double, + ss_ext_wholesale_cost Double, + ss_ext_list_price Double, + ss_ext_tax Double, + ss_coupon_amt Double, + ss_net_paid Double, + ss_net_paid_inc_tax Double, + ss_net_profit Double, + PRIMARY KEY (ss_item_sk, ss_ticket_number) ) --- (ss_item_sk, ss_ticket_number) WITH ( --- "/store_sales/", -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); Init tables ...Ok diff --git a/ydb/tests/functional/tpc/canondata/test_init.TestTpcdsInit.test_s1_s3/s1_s3 b/ydb/tests/functional/tpc/canondata/test_init.TestTpcdsInit.test_s1_s3/s1_s3 index 3223cf11cd3b..6caaf98e6956 100644 --- a/ydb/tests/functional/tpc/canondata/test_init.TestTpcdsInit.test_s1_s3/s1_s3 +++ b/ydb/tests/functional/tpc/canondata/test_init.TestTpcdsInit.test_s1_s3/s1_s3 @@ -1,675 +1,578 @@ Init tables ... +--!syntax_v1 +CREATE EXTERNAL DATA SOURCE `/Root/db/Root/db/tpcds/s1_s3_external_source` WITH ( + SOURCE_TYPE="ObjectStorage", + LOCATION="https://storage.yandexcloud.net/tpc", + AUTH_METHOD="NONE" +); - CREATE EXTERNAL DATA SOURCE `/Root/db/Root/db/tpcds/s1_s3_external_source` WITH ( - SOURCE_TYPE="ObjectStorage", - LOCATION="https://storage.yandexcloud.net/tpc", - AUTH_METHOD="NONE" - ); - - -CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/customer_address` -( - ca_address_sk Int64 NOT NULL, - ca_address_id Utf8, - ca_street_number Utf8, - ca_street_name Utf8, - ca_street_type Utf8, - ca_suite_number Utf8, - ca_city Utf8, - ca_county Utf8, - ca_state Utf8, - ca_zip Utf8, - ca_country Utf8, - ca_gmt_offset Double , - ca_location_type Utf8 - -- (ca_address_sk) +CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/customer_address` ( + ca_address_sk Int64 NOT NULL, + ca_address_id Utf8, + ca_street_number Utf8, + ca_street_name Utf8, + ca_street_type Utf8, + ca_suite_number Utf8, + ca_city Utf8, + ca_county Utf8, + ca_state Utf8, + ca_zip Utf8, + ca_country Utf8, + ca_gmt_offset Double, + ca_location_type Utf8 ) --- (ca_address_sk) WITH ( -DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/customer_address/", --- = 64 + DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/customer_address/" ); -CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/customer_demographics` -( - cd_demo_sk Int64 NOT NULL, - cd_gender Utf8, - cd_marital_status Utf8, - cd_education_status Utf8, - cd_purchase_estimate Int64 , - cd_credit_rating Utf8, - cd_dep_count Int64 , - cd_dep_employed_count Int64 , - cd_dep_college_count Int64 - -- (cd_demo_sk) +CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/customer_demographics` ( + cd_demo_sk Int64 NOT NULL, + cd_gender Utf8, + cd_marital_status Utf8, + cd_education_status Utf8, + cd_purchase_estimate Int64, + cd_credit_rating Utf8, + cd_dep_count Int64, + cd_dep_employed_count Int64, + cd_dep_college_count Int64 ) --- (cd_demo_sk) WITH ( -DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/customer_demographics/", --- = 64 + DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/customer_demographics/" ); -CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/date_dim` -( - d_date_sk Int64 NOT NULL, - d_date_id Utf8, - d_date Utf8, - d_month_seq Int64 , - d_week_seq Int64 , - d_quarter_seq Int64 , - d_year Int64 , - d_dow Int64 , - d_moy Int64 , - d_dom Int64 , - d_qoy Int64 , - d_fy_year Int64 , - d_fy_quarter_seq Int64 , - d_fy_week_seq Int64 , - d_day_name Utf8, - d_quarter_name Utf8, - d_holiday Utf8, - d_weekend Utf8, - d_following_holiday Utf8, - d_first_dom Int64 , - d_last_dom Int64 , - d_same_day_ly Int64 , - d_same_day_lq Int64 , - d_current_day Utf8, - d_current_week Utf8, - d_current_month Utf8, - d_current_quarter Utf8, - d_current_year Utf8 - -- (d_date_sk) +CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/date_dim` ( + d_date_sk Int64 NOT NULL, + d_date_id Utf8, + d_date Utf8, + d_month_seq Int64, + d_week_seq Int64, + d_quarter_seq Int64, + d_year Int64, + d_dow Int64, + d_moy Int64, + d_dom Int64, + d_qoy Int64, + d_fy_year Int64, + d_fy_quarter_seq Int64, + d_fy_week_seq Int64, + d_day_name Utf8, + d_quarter_name Utf8, + d_holiday Utf8, + d_weekend Utf8, + d_following_holiday Utf8, + d_first_dom Int64, + d_last_dom Int64, + d_same_day_ly Int64, + d_same_day_lq Int64, + d_current_day Utf8, + d_current_week Utf8, + d_current_month Utf8, + d_current_quarter Utf8, + d_current_year Utf8 ) --- (d_date_sk) WITH ( -DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/date_dim/", --- = 64 + DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/date_dim/" ); -CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/warehouse` -( - w_warehouse_sk Int64 NOT NULL, - w_warehouse_id Utf8, - w_warehouse_name Utf8, - w_warehouse_sq_ft Int64 , - w_street_number Utf8, - w_street_name Utf8, - w_street_type Utf8, - w_suite_number Utf8, - w_city Utf8, - w_county Utf8, - w_state Utf8, - w_zip Utf8, - w_country Utf8, - w_gmt_offset Double - -- (w_warehouse_sk) +CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/warehouse` ( + w_warehouse_sk Int64 NOT NULL, + w_warehouse_id Utf8, + w_warehouse_name Utf8, + w_warehouse_sq_ft Int64, + w_street_number Utf8, + w_street_name Utf8, + w_street_type Utf8, + w_suite_number Utf8, + w_city Utf8, + w_county Utf8, + w_state Utf8, + w_zip Utf8, + w_country Utf8, + w_gmt_offset Double ) --- (w_warehouse_sk) WITH ( -DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/warehouse/", --- = 64 + DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/warehouse/" ); -CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/ship_mode` -( - sm_ship_mode_sk Int64 NOT NULL, - sm_ship_mode_id Utf8, - sm_type Utf8, - sm_code Utf8, - sm_carrier Utf8, - sm_contract Utf8 - -- (sm_ship_mode_sk) +CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/ship_mode` ( + sm_ship_mode_sk Int64 NOT NULL, + sm_ship_mode_id Utf8, + sm_type Utf8, + sm_code Utf8, + sm_carrier Utf8, + sm_contract Utf8 ) --- (sm_ship_mode_sk) WITH ( -DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/ship_mode/", --- = 64 + DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/ship_mode/" ); -CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/time_dim` -( - t_time_sk Int64 NOT NULL, - t_time_id Utf8, - t_time Int64 , - t_hour Int64 , - t_minute Int64 , - t_second Int64 , - t_am_pm Utf8, - t_shift Utf8, - t_sub_shift Utf8, - t_meal_time Utf8 - -- (t_time_sk) +CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/time_dim` ( + t_time_sk Int64 NOT NULL, + t_time_id Utf8, + t_time Int64, + t_hour Int64, + t_minute Int64, + t_second Int64, + t_am_pm Utf8, + t_shift Utf8, + t_sub_shift Utf8, + t_meal_time Utf8 ) --- (t_time_sk) WITH ( -DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/time_dim/", --- = 64 + DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/time_dim/" ); -CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/reason` -( - r_reason_sk Int64 NOT NULL, - r_reason_id Utf8, - r_reason_desc Utf8 - -- (r_reason_sk) +CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/reason` ( + r_reason_sk Int64 NOT NULL, + r_reason_id Utf8, + r_reason_desc Utf8 ) --- (r_reason_sk) WITH ( -DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/reason/", --- = 64 + DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/reason/" ); -CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/income_band` -( - ib_income_band_sk Int64 NOT NULL, - ib_lower_bound Int64 , - ib_upper_bound Int64 - -- (ib_income_band_sk) +CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/income_band` ( + ib_income_band_sk Int64 NOT NULL, + ib_lower_bound Int64, + ib_upper_bound Int64 ) --- (ib_income_band_sk) WITH ( -DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/income_band/", --- = 64 + DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/income_band/" ); -CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/item` -( - i_item_sk Int64 NOT NULL, - i_item_id Utf8, - i_rec_start_date Date32 , - i_rec_end_date Date32 , - i_item_desc Utf8, - i_current_price Double, - i_wholesale_cost Double, - i_brand_id Int64 , - i_brand Utf8, - i_class_id Int64 , - i_class Utf8, - i_category_id Int64 , - i_category Utf8, - i_manufact_id Int64 , - i_manufact Utf8, - i_size Utf8, - i_formulation Utf8, - i_color Utf8, - i_units Utf8, - i_container Utf8, - i_manager_id Int64 , - i_product_name Utf8 - -- (i_item_sk) +CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/item` ( + i_item_sk Int64 NOT NULL, + i_item_id Utf8, + i_rec_start_date Date32, + i_rec_end_date Date32, + i_item_desc Utf8, + i_current_price Double, + i_wholesale_cost Double, + i_brand_id Int64, + i_brand Utf8, + i_class_id Int64, + i_class Utf8, + i_category_id Int64, + i_category Utf8, + i_manufact_id Int64, + i_manufact Utf8, + i_size Utf8, + i_formulation Utf8, + i_color Utf8, + i_units Utf8, + i_container Utf8, + i_manager_id Int64, + i_product_name Utf8 ) --- (i_item_sk) WITH ( -DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/item/", --- = 64 + DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/item/" ); -CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/store` -( - s_store_sk Int64 NOT NULL, - s_store_id Utf8, - s_rec_start_date Date32 , - s_rec_end_date Date32 , - s_closed_date_sk Int64 , - s_store_name Utf8, - s_number_employees Int64 , - s_floor_space Int64 , - s_hours Utf8, - s_manager Utf8, - s_market_id Int64 , - s_geography_class Utf8, - s_market_desc Utf8, - s_market_manager Utf8, - s_division_id Int64 , - s_division_name Utf8, - s_company_id Int64 , - s_company_name Utf8, - s_street_number Utf8, - s_street_name Utf8, - s_street_type Utf8, - s_suite_number Utf8, - s_city Utf8, - s_county Utf8, - s_state Utf8, - s_zip Utf8, - s_country Utf8, - s_gmt_offset Double, - s_tax_precentage Double - -- (s_store_sk) +CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/store` ( + s_store_sk Int64 NOT NULL, + s_store_id Utf8, + s_rec_start_date Date32, + s_rec_end_date Date32, + s_closed_date_sk Int64, + s_store_name Utf8, + s_number_employees Int64, + s_floor_space Int64, + s_hours Utf8, + s_manager Utf8, + s_market_id Int64, + s_geography_class Utf8, + s_market_desc Utf8, + s_market_manager Utf8, + s_division_id Int64, + s_division_name Utf8, + s_company_id Int64, + s_company_name Utf8, + s_street_number Utf8, + s_street_name Utf8, + s_street_type Utf8, + s_suite_number Utf8, + s_city Utf8, + s_county Utf8, + s_state Utf8, + s_zip Utf8, + s_country Utf8, + s_gmt_offset Double, + s_tax_precentage Double ) --- (s_store_sk) WITH ( -DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/store/", --- = 64 + DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/store/" ); -CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/call_center` -( - cc_call_center_sk Int64 NOT NULL, - cc_call_center_id Utf8, - cc_rec_start_date Date32 , - cc_rec_end_date Date32 , - cc_closed_date_sk Int64 , - cc_open_date_sk Int64 , - cc_name Utf8, - cc_class Utf8, - cc_employees Int64 , - cc_sq_ft Int64 , - cc_hours Utf8, - cc_manager Utf8, - cc_mkt_id Int64 , - cc_mkt_class Utf8, - cc_mkt_desc Utf8, - cc_market_manager Utf8, - cc_division Int64 , - cc_division_name Utf8, - cc_company Int64 , - cc_company_name Utf8, - cc_street_number Utf8, - cc_street_name Utf8, - cc_street_type Utf8, - cc_suite_number Utf8, - cc_city Utf8, - cc_county Utf8, - cc_state Utf8, - cc_zip Utf8, - cc_country Utf8, - cc_gmt_offset Double, - cc_tax_percentage Double - -- (cc_call_center_sk) +CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/call_center` ( + cc_call_center_sk Int64 NOT NULL, + cc_call_center_id Utf8, + cc_rec_start_date Date32, + cc_rec_end_date Date32, + cc_closed_date_sk Int64, + cc_open_date_sk Int64, + cc_name Utf8, + cc_class Utf8, + cc_employees Int64, + cc_sq_ft Int64, + cc_hours Utf8, + cc_manager Utf8, + cc_mkt_id Int64, + cc_mkt_class Utf8, + cc_mkt_desc Utf8, + cc_market_manager Utf8, + cc_division Int64, + cc_division_name Utf8, + cc_company Int64, + cc_company_name Utf8, + cc_street_number Utf8, + cc_street_name Utf8, + cc_street_type Utf8, + cc_suite_number Utf8, + cc_city Utf8, + cc_county Utf8, + cc_state Utf8, + cc_zip Utf8, + cc_country Utf8, + cc_gmt_offset Double, + cc_tax_percentage Double ) --- (cc_call_center_sk) WITH ( -DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/call_center/", --- = 64 + DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/call_center/" ); -CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/customer` -( - c_customer_sk Int64 NOT NULL, - c_customer_id Utf8, - c_current_cdemo_sk Int64 , - c_current_hdemo_sk Int64 , - c_current_addr_sk Int64 , - c_first_shipto_date_sk Int64 , - c_first_sales_date_sk Int64 , - c_salutation Utf8, - c_first_name Utf8, - c_last_name Utf8, - c_preferred_cust_flag Utf8, - c_birth_day Int64 , - c_birth_month Int64 , - c_birth_year Int64 , - c_birth_country Utf8, - c_login Utf8, - c_email_address Utf8, - c_last_review_date Utf8 - -- (c_customer_sk) +CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/customer` ( + c_customer_sk Int64 NOT NULL, + c_customer_id Utf8, + c_current_cdemo_sk Int64, + c_current_hdemo_sk Int64, + c_current_addr_sk Int64, + c_first_shipto_date_sk Int64, + c_first_sales_date_sk Int64, + c_salutation Utf8, + c_first_name Utf8, + c_last_name Utf8, + c_preferred_cust_flag Utf8, + c_birth_day Int64, + c_birth_month Int64, + c_birth_year Int64, + c_birth_country Utf8, + c_login Utf8, + c_email_address Utf8, + c_last_review_date Utf8 ) --- (c_customer_sk) WITH ( -DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/customer/", --- = 64 + DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/customer/" ); -CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/web_site` -( - web_site_sk Int64 NOT NULL, - web_site_id Utf8, - web_rec_start_date Date32 , - web_rec_end_date Date32 , - web_name Utf8, - web_open_date_sk Int64 , - web_close_date_sk Int64 , - web_class Utf8, - web_manager Utf8, - web_mkt_id Int64 , - web_mkt_class Utf8, - web_mkt_desc Utf8, - web_market_manager Utf8, - web_company_id Int64 , - web_company_name Utf8, - web_street_number Utf8, - web_street_name Utf8, - web_street_type Utf8, - web_suite_number Utf8, - web_city Utf8, - web_county Utf8, - web_state Utf8, - web_zip Utf8, - web_country Utf8, - web_gmt_offset Double, - web_tax_percentage Double - -- (web_site_sk) +CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/web_site` ( + web_site_sk Int64 NOT NULL, + web_site_id Utf8, + web_rec_start_date Date32, + web_rec_end_date Date32, + web_name Utf8, + web_open_date_sk Int64, + web_close_date_sk Int64, + web_class Utf8, + web_manager Utf8, + web_mkt_id Int64, + web_mkt_class Utf8, + web_mkt_desc Utf8, + web_market_manager Utf8, + web_company_id Int64, + web_company_name Utf8, + web_street_number Utf8, + web_street_name Utf8, + web_street_type Utf8, + web_suite_number Utf8, + web_city Utf8, + web_county Utf8, + web_state Utf8, + web_zip Utf8, + web_country Utf8, + web_gmt_offset Double, + web_tax_percentage Double ) --- (web_site_sk) WITH ( -DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/web_site/", --- = 64 + DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/web_site/" ); -CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/store_returns` -( - sr_returned_date_sk Int64 , - sr_return_time_sk Int64 , - sr_item_sk Int64 NOT NULL, - sr_customer_sk Int64 , - sr_cdemo_sk Int64 , - sr_hdemo_sk Int64 , - sr_addr_sk Int64 , - sr_store_sk Int64 , - sr_reason_sk Int64 , - sr_ticket_number Int64 NOT NULL, - sr_return_quantity Int64 , - sr_return_amt Double, - sr_return_tax Double, - sr_return_amt_inc_tax Double, - sr_fee Double, - sr_return_ship_cost Double, - sr_refunded_cash Double, - sr_reversed_charge Double, - sr_store_credit Double, - sr_net_loss Double - -- (sr_item_sk, sr_ticket_number) +CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/store_returns` ( + sr_returned_date_sk Int64, + sr_return_time_sk Int64, + sr_item_sk Int64 NOT NULL, + sr_customer_sk Int64, + sr_cdemo_sk Int64, + sr_hdemo_sk Int64, + sr_addr_sk Int64, + sr_store_sk Int64, + sr_reason_sk Int64, + sr_ticket_number Int64 NOT NULL, + sr_return_quantity Int64, + sr_return_amt Double, + sr_return_tax Double, + sr_return_amt_inc_tax Double, + sr_fee Double, + sr_return_ship_cost Double, + sr_refunded_cash Double, + sr_reversed_charge Double, + sr_store_credit Double, + sr_net_loss Double ) --- (sr_item_sk, sr_ticket_number) WITH ( -DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/store_returns/", --- = 64 + DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/store_returns/" ); -CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/household_demographics` -( - hd_demo_sk Int64 NOT NULL, - hd_income_band_sk Int64 , - hd_buy_potential Utf8, - hd_dep_count Int64 , - hd_vehicle_count Int64 - -- (hd_demo_sk) +CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/household_demographics` ( + hd_demo_sk Int64 NOT NULL, + hd_income_band_sk Int64, + hd_buy_potential Utf8, + hd_dep_count Int64, + hd_vehicle_count Int64 ) --- (hd_demo_sk) WITH ( -DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/household_demographics/", --- = 64 + DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/household_demographics/" ); -CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/web_page` -( - wp_web_page_sk Int64 NOT NULL, - wp_web_page_id Utf8, - wp_rec_start_date Date32 , - wp_rec_end_date Date32 , - wp_creation_date_sk Int64 , - wp_access_date_sk Int64 , - wp_autogen_flag Utf8, - wp_customer_sk Int64 , - wp_url Utf8, - wp_type Utf8, - wp_char_count Int64 , - wp_link_count Int64 , - wp_image_count Int64 , - wp_max_ad_count Int64 - -- (wp_web_page_sk) +CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/web_page` ( + wp_web_page_sk Int64 NOT NULL, + wp_web_page_id Utf8, + wp_rec_start_date Date32, + wp_rec_end_date Date32, + wp_creation_date_sk Int64, + wp_access_date_sk Int64, + wp_autogen_flag Utf8, + wp_customer_sk Int64, + wp_url Utf8, + wp_type Utf8, + wp_char_count Int64, + wp_link_count Int64, + wp_image_count Int64, + wp_max_ad_count Int64 ) --- (wp_web_page_sk) WITH ( -DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/web_page/", --- = 64 + DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/web_page/" ); -CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/promotion` -( - p_promo_sk Int64 NOT NULL, - p_promo_id Utf8, - p_start_date_sk Int64 , - p_end_date_sk Int64 , - p_item_sk Int64 , - p_cost Double, - p_response_target Int64 , - p_promo_name Utf8, - p_channel_dmail Utf8, - p_channel_email Utf8, - p_channel_catalog Utf8, - p_channel_tv Utf8, - p_channel_radio Utf8, - p_channel_press Utf8, - p_channel_event Utf8, - p_channel_demo Utf8, - p_channel_details Utf8, - p_purpose Utf8, - p_discount_active Utf8 - -- (p_promo_sk) +CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/promotion` ( + p_promo_sk Int64 NOT NULL, + p_promo_id Utf8, + p_start_date_sk Int64, + p_end_date_sk Int64, + p_item_sk Int64, + p_cost Double, + p_response_target Int64, + p_promo_name Utf8, + p_channel_dmail Utf8, + p_channel_email Utf8, + p_channel_catalog Utf8, + p_channel_tv Utf8, + p_channel_radio Utf8, + p_channel_press Utf8, + p_channel_event Utf8, + p_channel_demo Utf8, + p_channel_details Utf8, + p_purpose Utf8, + p_discount_active Utf8 ) --- (p_promo_sk) WITH ( -DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/promotion/", --- = 64 + DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/promotion/" ); -CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/catalog_page` -( - cp_catalog_page_sk Int64 NOT NULL, - cp_catalog_page_id Utf8, - cp_start_date_sk Int64 , - cp_end_date_sk Int64 , - cp_department Utf8, - cp_catalog_number Int64 , - cp_catalog_page_number Int64 , - cp_description Utf8, - cp_type Utf8 - -- (cp_catalog_page_sk) +CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/catalog_page` ( + cp_catalog_page_sk Int64 NOT NULL, + cp_catalog_page_id Utf8, + cp_start_date_sk Int64, + cp_end_date_sk Int64, + cp_department Utf8, + cp_catalog_number Int64, + cp_catalog_page_number Int64, + cp_description Utf8, + cp_type Utf8 ) --- (cp_catalog_page_sk) WITH ( -DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/catalog_page/", --- = 64 + DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/catalog_page/" ); -CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/inventory` -( - inv_date_sk Int64 NOT NULL, - inv_item_sk Int64 NOT NULL, - inv_warehouse_sk Int64 NOT NULL, - inv_quantity_on_hand Int64 - -- (inv_date_sk, inv_item_sk, inv_warehouse_sk) +CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/inventory` ( + inv_date_sk Int64 NOT NULL, + inv_item_sk Int64 NOT NULL, + inv_warehouse_sk Int64 NOT NULL, + inv_quantity_on_hand Int64 ) --- (inv_date_sk, inv_item_sk, inv_warehouse_sk) WITH ( -DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/inventory/", --- = 64 + DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/inventory/" ); -CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/catalog_returns` -( - cr_returned_date_sk Int64 , - cr_returned_time_sk Int64 , - cr_item_sk Int64 NOT NULL, - cr_refunded_customer_sk Int64 , - cr_refunded_cdemo_sk Int64 , - cr_refunded_hdemo_sk Int64 , - cr_refunded_addr_sk Int64 , - cr_returning_customer_sk Int64 , - cr_returning_cdemo_sk Int64 , - cr_returning_hdemo_sk Int64 , - cr_returning_addr_sk Int64 , - cr_call_center_sk Int64 , - cr_catalog_page_sk Int64 , - cr_ship_mode_sk Int64 , - cr_warehouse_sk Int64 , - cr_reason_sk Int64 , - cr_order_number Int64 NOT NULL, - cr_return_quantity Int64 , - cr_return_amount Double, - cr_return_tax Double, - cr_return_amt_inc_tax Double, - cr_fee Double, - cr_return_ship_cost Double, - cr_refunded_cash Double, - cr_reversed_charge Double, - cr_store_credit Double, - cr_net_loss Double - -- (cr_item_sk, cr_order_number) +CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/catalog_returns` ( + cr_returned_date_sk Int64, + cr_returned_time_sk Int64, + cr_item_sk Int64 NOT NULL, + cr_refunded_customer_sk Int64, + cr_refunded_cdemo_sk Int64, + cr_refunded_hdemo_sk Int64, + cr_refunded_addr_sk Int64, + cr_returning_customer_sk Int64, + cr_returning_cdemo_sk Int64, + cr_returning_hdemo_sk Int64, + cr_returning_addr_sk Int64, + cr_call_center_sk Int64, + cr_catalog_page_sk Int64, + cr_ship_mode_sk Int64, + cr_warehouse_sk Int64, + cr_reason_sk Int64, + cr_order_number Int64 NOT NULL, + cr_return_quantity Int64, + cr_return_amount Double, + cr_return_tax Double, + cr_return_amt_inc_tax Double, + cr_fee Double, + cr_return_ship_cost Double, + cr_refunded_cash Double, + cr_reversed_charge Double, + cr_store_credit Double, + cr_net_loss Double ) --- (cr_item_sk, cr_order_number) WITH ( -DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/catalog_returns/", --- = 64 + DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/catalog_returns/" ); -CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/web_returns` -( - wr_returned_date_sk Int64 , - wr_returned_time_sk Int64 , - wr_item_sk Int64 NOT NULL, - wr_refunded_customer_sk Int64 , - wr_refunded_cdemo_sk Int64 , - wr_refunded_hdemo_sk Int64 , - wr_refunded_addr_sk Int64 , - wr_returning_customer_sk Int64 , - wr_returning_cdemo_sk Int64 , - wr_returning_hdemo_sk Int64 , - wr_returning_addr_sk Int64 , - wr_web_page_sk Int64 , - wr_reason_sk Int64 , - wr_order_number Int64 NOT NULL, - wr_return_quantity Int64 , - wr_return_amt Double, - wr_return_tax Double, - wr_return_amt_inc_tax Double, - wr_fee Double, - wr_return_ship_cost Double, - wr_refunded_cash Double, - wr_reversed_charge Double, - wr_account_credit Double, - wr_net_loss Double - -- (wr_item_sk, wr_order_number) +CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/web_returns` ( + wr_returned_date_sk Int64, + wr_returned_time_sk Int64, + wr_item_sk Int64 NOT NULL, + wr_refunded_customer_sk Int64, + wr_refunded_cdemo_sk Int64, + wr_refunded_hdemo_sk Int64, + wr_refunded_addr_sk Int64, + wr_returning_customer_sk Int64, + wr_returning_cdemo_sk Int64, + wr_returning_hdemo_sk Int64, + wr_returning_addr_sk Int64, + wr_web_page_sk Int64, + wr_reason_sk Int64, + wr_order_number Int64 NOT NULL, + wr_return_quantity Int64, + wr_return_amt Double, + wr_return_tax Double, + wr_return_amt_inc_tax Double, + wr_fee Double, + wr_return_ship_cost Double, + wr_refunded_cash Double, + wr_reversed_charge Double, + wr_account_credit Double, + wr_net_loss Double ) --- (wr_item_sk, wr_order_number) WITH ( -DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/web_returns/", --- = 64 + DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/web_returns/" ); -CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/web_sales` -( - ws_sold_date_sk Int64 , - ws_sold_time_sk Int64 , - ws_ship_date_sk Int64 , - ws_item_sk Int64 NOT NULL, - ws_bill_customer_sk Int64 , - ws_bill_cdemo_sk Int64 , - ws_bill_hdemo_sk Int64 , - ws_bill_addr_sk Int64 , - ws_ship_customer_sk Int64 , - ws_ship_cdemo_sk Int64 , - ws_ship_hdemo_sk Int64 , - ws_ship_addr_sk Int64 , - ws_web_page_sk Int64 , - ws_web_site_sk Int64 , - ws_ship_mode_sk Int64 , - ws_warehouse_sk Int64 , - ws_promo_sk Int64 , - ws_order_number Int64 NOT NULL, - ws_quantity Int64 , - ws_wholesale_cost Double, - ws_list_price Double, - ws_sales_price Double, - ws_ext_discount_amt Double, - ws_ext_sales_price Double, - ws_ext_wholesale_cost Double, - ws_ext_list_price Double, - ws_ext_tax Double, - ws_coupon_amt Double, - ws_ext_ship_cost Double, - ws_net_paid Double, - ws_net_paid_inc_tax Double, - ws_net_paid_inc_ship Double, - ws_net_paid_inc_ship_tax Double, - ws_net_profit Double - -- (ws_item_sk, ws_order_number) +CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/web_sales` ( + ws_sold_date_sk Int64, + ws_sold_time_sk Int64, + ws_ship_date_sk Int64, + ws_item_sk Int64 NOT NULL, + ws_bill_customer_sk Int64, + ws_bill_cdemo_sk Int64, + ws_bill_hdemo_sk Int64, + ws_bill_addr_sk Int64, + ws_ship_customer_sk Int64, + ws_ship_cdemo_sk Int64, + ws_ship_hdemo_sk Int64, + ws_ship_addr_sk Int64, + ws_web_page_sk Int64, + ws_web_site_sk Int64, + ws_ship_mode_sk Int64, + ws_warehouse_sk Int64, + ws_promo_sk Int64, + ws_order_number Int64 NOT NULL, + ws_quantity Int64, + ws_wholesale_cost Double, + ws_list_price Double, + ws_sales_price Double, + ws_ext_discount_amt Double, + ws_ext_sales_price Double, + ws_ext_wholesale_cost Double, + ws_ext_list_price Double, + ws_ext_tax Double, + ws_coupon_amt Double, + ws_ext_ship_cost Double, + ws_net_paid Double, + ws_net_paid_inc_tax Double, + ws_net_paid_inc_ship Double, + ws_net_paid_inc_ship_tax Double, + ws_net_profit Double ) --- (ws_item_sk, ws_order_number) WITH ( -DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/web_sales/", --- = 64 + DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/web_sales/" ); -CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/catalog_sales` -( - cs_sold_date_sk Int64 , - cs_sold_time_sk Int64 , - cs_ship_date_sk Int64 , - cs_bill_customer_sk Int64 , - cs_bill_cdemo_sk Int64 , - cs_bill_hdemo_sk Int64 , - cs_bill_addr_sk Int64 , - cs_ship_customer_sk Int64 , - cs_ship_cdemo_sk Int64 , - cs_ship_hdemo_sk Int64 , - cs_ship_addr_sk Int64 , - cs_call_center_sk Int64 , - cs_catalog_page_sk Int64 , - cs_ship_mode_sk Int64 , - cs_warehouse_sk Int64 , - cs_item_sk Int64 NOT NULL, - cs_promo_sk Int64 , - cs_order_number Int64 NOT NULL, - cs_quantity Int64 , - cs_wholesale_cost Double, - cs_list_price Double, - cs_sales_price Double, - cs_ext_discount_amt Double, - cs_ext_sales_price Double, - cs_ext_wholesale_cost Double, - cs_ext_list_price Double, - cs_ext_tax Double, - cs_coupon_amt Double, - cs_ext_ship_cost Double, - cs_net_paid Double, - cs_net_paid_inc_tax Double, - cs_net_paid_inc_ship Double, - cs_net_paid_inc_ship_tax Double, - cs_net_profit Double - -- (cs_item_sk, cs_order_number) +CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/catalog_sales` ( + cs_sold_date_sk Int64, + cs_sold_time_sk Int64, + cs_ship_date_sk Int64, + cs_bill_customer_sk Int64, + cs_bill_cdemo_sk Int64, + cs_bill_hdemo_sk Int64, + cs_bill_addr_sk Int64, + cs_ship_customer_sk Int64, + cs_ship_cdemo_sk Int64, + cs_ship_hdemo_sk Int64, + cs_ship_addr_sk Int64, + cs_call_center_sk Int64, + cs_catalog_page_sk Int64, + cs_ship_mode_sk Int64, + cs_warehouse_sk Int64, + cs_item_sk Int64 NOT NULL, + cs_promo_sk Int64, + cs_order_number Int64 NOT NULL, + cs_quantity Int64, + cs_wholesale_cost Double, + cs_list_price Double, + cs_sales_price Double, + cs_ext_discount_amt Double, + cs_ext_sales_price Double, + cs_ext_wholesale_cost Double, + cs_ext_list_price Double, + cs_ext_tax Double, + cs_coupon_amt Double, + cs_ext_ship_cost Double, + cs_net_paid Double, + cs_net_paid_inc_tax Double, + cs_net_paid_inc_ship Double, + cs_net_paid_inc_ship_tax Double, + cs_net_profit Double ) --- (cs_item_sk, cs_order_number) WITH ( -DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/catalog_sales/", --- = 64 + DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/catalog_sales/" ); -CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/store_sales` -( - ss_sold_date_sk Int64 , - ss_sold_time_sk Int64 , - ss_item_sk Int64 NOT NULL, - ss_customer_sk Int64 , - ss_cdemo_sk Int64 , - ss_hdemo_sk Int64 , - ss_addr_sk Int64 , - ss_store_sk Int64 , - ss_promo_sk Int64 , - ss_ticket_number Int64 NOT NULL, - ss_quantity Int64 , - ss_wholesale_cost Double, - ss_list_price Double, - ss_sales_price Double, - ss_ext_discount_amt Double, - ss_ext_sales_price Double, - ss_ext_wholesale_cost Double, - ss_ext_list_price Double, - ss_ext_tax Double, - ss_coupon_amt Double, - ss_net_paid Double, - ss_net_paid_inc_tax Double, - ss_net_profit Double - -- (ss_item_sk, ss_ticket_number) +CREATE EXTERNAL TABLE `/Root/db/Root/db/tpcds/s1/store_sales` ( + ss_sold_date_sk Int64, + ss_sold_time_sk Int64, + ss_item_sk Int64 NOT NULL, + ss_customer_sk Int64, + ss_cdemo_sk Int64, + ss_hdemo_sk Int64, + ss_addr_sk Int64, + ss_store_sk Int64, + ss_promo_sk Int64, + ss_ticket_number Int64 NOT NULL, + ss_quantity Int64, + ss_wholesale_cost Double, + ss_list_price Double, + ss_sales_price Double, + ss_ext_discount_amt Double, + ss_ext_sales_price Double, + ss_ext_wholesale_cost Double, + ss_ext_list_price Double, + ss_ext_tax Double, + ss_coupon_amt Double, + ss_net_paid Double, + ss_net_paid_inc_tax Double, + ss_net_profit Double ) --- (ss_item_sk, ss_ticket_number) WITH ( -DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/store_sales/", --- = 64 + DATA_SOURCE = "/Root/db/Root/db/tpcds/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/store_sales/" ); Init tables ...Ok diff --git a/ydb/tests/functional/tpc/canondata/test_init.TestTpchInit.test_s1_column/s1_column b/ydb/tests/functional/tpc/canondata/test_init.TestTpchInit.test_s1_column/s1_column index cc0785ffa595..46f1f8f1316a 100644 --- a/ydb/tests/functional/tpc/canondata/test_init.TestTpchInit.test_s1_column/s1_column +++ b/ydb/tests/functional/tpc/canondata/test_init.TestTpchInit.test_s1_column/s1_column @@ -1,130 +1,137 @@ Init tables ... +--!syntax_v1 - -CREATE TABLE `/Root/db/Root/db/tpch/s1/customer` ( - c_acctbal Double NOT NULL, -- it should be Decimal(12, 2) +CREATE TABLE `/Root/db/Root/db/tpch/s1/customer` ( + c_acctbal Double NOT NULL, c_address Utf8 NOT NULL, c_comment Utf8 NOT NULL, - c_custkey Int64 NOT NULL, -- Identifier + c_custkey Int64 NOT NULL, c_mktsegment Utf8 NOT NULL, c_name Utf8 NOT NULL, - c_nationkey Int32 NOT NULL, -- FK to N_NATIONKEY - c_phone Utf8 NOT NULL - , PRIMARY KEY (c_custkey) + c_nationkey Int32 NOT NULL, + c_phone Utf8 NOT NULL, + PRIMARY KEY (c_custkey) ) -PARTITION BY HASH(c_custkey) -WITH (STORE = COLUMN, --"/customer/" -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 +PARTITION BY HASH (c_custkey) +WITH ( + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpch/s1/lineitem` ( +CREATE TABLE `/Root/db/Root/db/tpch/s1/lineitem` ( l_comment Utf8 NOT NULL, l_commitdate Date32 NOT NULL, - l_discount Double NOT NULL, -- it should be Decimal(12, 2) - l_extendedprice Double NOT NULL, -- it should be Decimal(12, 2) + l_discount Double NOT NULL, + l_extendedprice Double NOT NULL, l_linenumber Int32 NOT NULL, l_linestatus Utf8 NOT NULL, - l_orderkey Int64 NOT NULL, -- FK to O_ORDERKEY - l_partkey Int64 NOT NULL, -- FK to P_PARTKEY, first part of the compound FK to (PS_PARTKEY, PS_SUPPKEY) with L_SUPPKEY - l_quantity Double NOT NULL, -- it should be Decimal(12, 2) + l_orderkey Int64 NOT NULL, + l_partkey Int64 NOT NULL, + l_quantity Double NOT NULL, l_receiptdate Date32 NOT NULL, l_returnflag Utf8 NOT NULL, l_shipdate Date32 NOT NULL, l_shipinstruct Utf8 NOT NULL, l_shipmode Utf8 NOT NULL, - l_suppkey Int64 NOT NULL, -- FK to S_SUPPKEY, second part of the compound FK to (PS_PARTKEY, PS_SUPPKEY) with L_PARTKEY - l_tax Double NOT NULL -- it should be Decimal(12, 2) - , PRIMARY KEY (l_orderkey, l_linenumber) + l_suppkey Int64 NOT NULL, + l_tax Double NOT NULL, + PRIMARY KEY (l_orderkey, l_linenumber) ) -PARTITION BY HASH(l_orderkey) -WITH (STORE = COLUMN, --"/lineitem/" -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 +PARTITION BY HASH (l_orderkey, l_linenumber) +WITH ( + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpch/s1/nation` ( +CREATE TABLE `/Root/db/Root/db/tpch/s1/nation` ( n_comment Utf8 NOT NULL, n_name Utf8 NOT NULL, - n_nationkey Int32 NOT NULL, -- Identifier - n_regionkey Int32 NOT NULL -- FK to R_REGIONKEY - , PRIMARY KEY(n_nationkey) + n_nationkey Int32 NOT NULL, + n_regionkey Int32 NOT NULL, + PRIMARY KEY (n_nationkey) ) -PARTITION BY HASH(n_nationkey) - -WITH (STORE = COLUMN, --"/nation/" -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 1 +PARTITION BY HASH (n_nationkey) +WITH ( + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 1 ); -CREATE TABLE `/Root/db/Root/db/tpch/s1/orders` ( +CREATE TABLE `/Root/db/Root/db/tpch/s1/orders` ( o_clerk Utf8 NOT NULL, o_comment Utf8 NOT NULL, - o_custkey Int64 NOT NULL, -- FK to C_CUSTKEY + o_custkey Int64 NOT NULL, o_orderdate Date32 NOT NULL, - o_orderkey Int64 NOT NULL, -- Identifier + o_orderkey Int64 NOT NULL, o_orderpriority Utf8 NOT NULL, o_orderstatus Utf8 NOT NULL, o_shippriority Int32 NOT NULL, - o_totalprice Double NOT NULL -- it should be Decimal(12, 2) - , PRIMARY KEY (o_orderkey) + o_totalprice Double NOT NULL, + PRIMARY KEY (o_orderkey) ) -PARTITION BY HASH(o_orderkey) -WITH (STORE = COLUMN, --"/orders/" -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 +PARTITION BY HASH (o_orderkey) +WITH ( + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpch/s1/part` ( +CREATE TABLE `/Root/db/Root/db/tpch/s1/part` ( p_brand Utf8 NOT NULL, p_comment Utf8 NOT NULL, p_container Utf8 NOT NULL, p_mfgr Utf8 NOT NULL, p_name Utf8 NOT NULL, - p_partkey Int64 NOT NULL, -- Identifier - p_retailprice Double NOT NULL, -- it should be Decimal(12, 2) + p_partkey Int64 NOT NULL, + p_retailprice Double NOT NULL, p_size Int32 NOT NULL, - p_type Utf8 NOT NULL - , PRIMARY KEY(p_partkey) + p_type Utf8 NOT NULL, + PRIMARY KEY (p_partkey) ) -PARTITION BY HASH(p_partkey) -WITH (STORE = COLUMN, --"/part/" -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 +PARTITION BY HASH (p_partkey) +WITH ( + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpch/s1/partsupp` ( +CREATE TABLE `/Root/db/Root/db/tpch/s1/partsupp` ( ps_availqty Int32 NOT NULL, ps_comment Utf8 NOT NULL, - ps_partkey Int64 NOT NULL, -- FK to P_PARTKEY - ps_suppkey Int64 NOT NULL, -- FK to S_SUPPKEY - ps_supplycost Double NOT NULL -- it should be Decimal(12, 2) - , PRIMARY KEY(ps_partkey, ps_suppkey) + ps_partkey Int64 NOT NULL, + ps_suppkey Int64 NOT NULL, + ps_supplycost Double NOT NULL, + PRIMARY KEY (ps_partkey) ) -PARTITION BY HASH(ps_partkey) -WITH (STORE = COLUMN, --"/partsupp/" -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 +PARTITION BY HASH (ps_partkey) +WITH ( + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpch/s1/region` ( +CREATE TABLE `/Root/db/Root/db/tpch/s1/region` ( r_comment Utf8 NOT NULL, r_name Utf8 NOT NULL, - r_regionkey Int32 NOT NULL -- Identifier - , PRIMARY KEY(r_regionkey) + r_regionkey Int32 NOT NULL, + PRIMARY KEY (r_regionkey) ) -PARTITION BY HASH(r_regionkey) -WITH (STORE = COLUMN, --"/region/" -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 1 +PARTITION BY HASH (r_regionkey) +WITH ( + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 1 ); -CREATE TABLE `/Root/db/Root/db/tpch/s1/supplier` ( - s_acctbal Double NOT NULL, -- it should be Decimal(12, 2) +CREATE TABLE `/Root/db/Root/db/tpch/s1/supplier` ( + s_acctbal Double NOT NULL, s_address Utf8 NOT NULL, s_comment Utf8 NOT NULL, s_name Utf8 NOT NULL, - s_nationkey Int32 NOT NULL, -- FK to N_NATIONKEY + s_nationkey Int32 NOT NULL, s_phone Utf8 NOT NULL, - s_suppkey Int64 NOT NULL -- Identifier - , PRIMARY KEY(s_suppkey) + s_suppkey Int64 NOT NULL, + PRIMARY KEY (s_suppkey) ) -PARTITION BY HASH(s_suppkey) -WITH (STORE = COLUMN, --"/supplier/" -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 +PARTITION BY HASH (s_suppkey) +WITH ( + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); Init tables ...Ok diff --git a/ydb/tests/functional/tpc/canondata/test_init.TestTpchInit.test_s1_column_decimal/s1_column_decimal b/ydb/tests/functional/tpc/canondata/test_init.TestTpchInit.test_s1_column_decimal/s1_column_decimal index 8292f3ee5e3a..ad757576beb9 100644 --- a/ydb/tests/functional/tpc/canondata/test_init.TestTpchInit.test_s1_column_decimal/s1_column_decimal +++ b/ydb/tests/functional/tpc/canondata/test_init.TestTpchInit.test_s1_column_decimal/s1_column_decimal @@ -1,130 +1,137 @@ Init tables ... +--!syntax_v1 - -CREATE TABLE `/Root/db/Root/db/tpch/s1/customer` ( - c_acctbal Decimal(12,2) NOT NULL, -- it should be Decimal(12, 2) +CREATE TABLE `/Root/db/Root/db/tpch/s1/customer` ( + c_acctbal Decimal(12,2) NOT NULL, c_address Utf8 NOT NULL, c_comment Utf8 NOT NULL, - c_custkey Int64 NOT NULL, -- Identifier + c_custkey Int64 NOT NULL, c_mktsegment Utf8 NOT NULL, c_name Utf8 NOT NULL, - c_nationkey Int32 NOT NULL, -- FK to N_NATIONKEY - c_phone Utf8 NOT NULL - , PRIMARY KEY (c_custkey) + c_nationkey Int32 NOT NULL, + c_phone Utf8 NOT NULL, + PRIMARY KEY (c_custkey) ) -PARTITION BY HASH(c_custkey) -WITH (STORE = COLUMN, --"/customer/" -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 +PARTITION BY HASH (c_custkey) +WITH ( + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpch/s1/lineitem` ( +CREATE TABLE `/Root/db/Root/db/tpch/s1/lineitem` ( l_comment Utf8 NOT NULL, l_commitdate Date32 NOT NULL, - l_discount Decimal(12,2) NOT NULL, -- it should be Decimal(12, 2) - l_extendedprice Decimal(12,2) NOT NULL, -- it should be Decimal(12, 2) + l_discount Decimal(12,2) NOT NULL, + l_extendedprice Decimal(12,2) NOT NULL, l_linenumber Int32 NOT NULL, l_linestatus Utf8 NOT NULL, - l_orderkey Int64 NOT NULL, -- FK to O_ORDERKEY - l_partkey Int64 NOT NULL, -- FK to P_PARTKEY, first part of the compound FK to (PS_PARTKEY, PS_SUPPKEY) with L_SUPPKEY - l_quantity Decimal(12,2) NOT NULL, -- it should be Decimal(12, 2) + l_orderkey Int64 NOT NULL, + l_partkey Int64 NOT NULL, + l_quantity Decimal(12,2) NOT NULL, l_receiptdate Date32 NOT NULL, l_returnflag Utf8 NOT NULL, l_shipdate Date32 NOT NULL, l_shipinstruct Utf8 NOT NULL, l_shipmode Utf8 NOT NULL, - l_suppkey Int64 NOT NULL, -- FK to S_SUPPKEY, second part of the compound FK to (PS_PARTKEY, PS_SUPPKEY) with L_PARTKEY - l_tax Decimal(12,2) NOT NULL -- it should be Decimal(12, 2) - , PRIMARY KEY (l_orderkey, l_linenumber) + l_suppkey Int64 NOT NULL, + l_tax Decimal(12,2) NOT NULL, + PRIMARY KEY (l_orderkey, l_linenumber) ) -PARTITION BY HASH(l_orderkey) -WITH (STORE = COLUMN, --"/lineitem/" -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 +PARTITION BY HASH (l_orderkey, l_linenumber) +WITH ( + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpch/s1/nation` ( +CREATE TABLE `/Root/db/Root/db/tpch/s1/nation` ( n_comment Utf8 NOT NULL, n_name Utf8 NOT NULL, - n_nationkey Int32 NOT NULL, -- Identifier - n_regionkey Int32 NOT NULL -- FK to R_REGIONKEY - , PRIMARY KEY(n_nationkey) + n_nationkey Int32 NOT NULL, + n_regionkey Int32 NOT NULL, + PRIMARY KEY (n_nationkey) ) -PARTITION BY HASH(n_nationkey) - -WITH (STORE = COLUMN, --"/nation/" -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 1 +PARTITION BY HASH (n_nationkey) +WITH ( + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 1 ); -CREATE TABLE `/Root/db/Root/db/tpch/s1/orders` ( +CREATE TABLE `/Root/db/Root/db/tpch/s1/orders` ( o_clerk Utf8 NOT NULL, o_comment Utf8 NOT NULL, - o_custkey Int64 NOT NULL, -- FK to C_CUSTKEY + o_custkey Int64 NOT NULL, o_orderdate Date32 NOT NULL, - o_orderkey Int64 NOT NULL, -- Identifier + o_orderkey Int64 NOT NULL, o_orderpriority Utf8 NOT NULL, o_orderstatus Utf8 NOT NULL, o_shippriority Int32 NOT NULL, - o_totalprice Decimal(12,2) NOT NULL -- it should be Decimal(12, 2) - , PRIMARY KEY (o_orderkey) + o_totalprice Decimal(12,2) NOT NULL, + PRIMARY KEY (o_orderkey) ) -PARTITION BY HASH(o_orderkey) -WITH (STORE = COLUMN, --"/orders/" -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 +PARTITION BY HASH (o_orderkey) +WITH ( + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpch/s1/part` ( +CREATE TABLE `/Root/db/Root/db/tpch/s1/part` ( p_brand Utf8 NOT NULL, p_comment Utf8 NOT NULL, p_container Utf8 NOT NULL, p_mfgr Utf8 NOT NULL, p_name Utf8 NOT NULL, - p_partkey Int64 NOT NULL, -- Identifier - p_retailprice Decimal(12,2) NOT NULL, -- it should be Decimal(12, 2) + p_partkey Int64 NOT NULL, + p_retailprice Decimal(12,2) NOT NULL, p_size Int32 NOT NULL, - p_type Utf8 NOT NULL - , PRIMARY KEY(p_partkey) + p_type Utf8 NOT NULL, + PRIMARY KEY (p_partkey) ) -PARTITION BY HASH(p_partkey) -WITH (STORE = COLUMN, --"/part/" -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 +PARTITION BY HASH (p_partkey) +WITH ( + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpch/s1/partsupp` ( +CREATE TABLE `/Root/db/Root/db/tpch/s1/partsupp` ( ps_availqty Int32 NOT NULL, ps_comment Utf8 NOT NULL, - ps_partkey Int64 NOT NULL, -- FK to P_PARTKEY - ps_suppkey Int64 NOT NULL, -- FK to S_SUPPKEY - ps_supplycost Decimal(12,2) NOT NULL -- it should be Decimal(12, 2) - , PRIMARY KEY(ps_partkey, ps_suppkey) + ps_partkey Int64 NOT NULL, + ps_suppkey Int64 NOT NULL, + ps_supplycost Decimal(12,2) NOT NULL, + PRIMARY KEY (ps_partkey) ) -PARTITION BY HASH(ps_partkey) -WITH (STORE = COLUMN, --"/partsupp/" -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 +PARTITION BY HASH (ps_partkey) +WITH ( + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpch/s1/region` ( +CREATE TABLE `/Root/db/Root/db/tpch/s1/region` ( r_comment Utf8 NOT NULL, r_name Utf8 NOT NULL, - r_regionkey Int32 NOT NULL -- Identifier - , PRIMARY KEY(r_regionkey) + r_regionkey Int32 NOT NULL, + PRIMARY KEY (r_regionkey) ) -PARTITION BY HASH(r_regionkey) -WITH (STORE = COLUMN, --"/region/" -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 1 +PARTITION BY HASH (r_regionkey) +WITH ( + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 1 ); -CREATE TABLE `/Root/db/Root/db/tpch/s1/supplier` ( - s_acctbal Decimal(12,2) NOT NULL, -- it should be Decimal(12, 2) +CREATE TABLE `/Root/db/Root/db/tpch/s1/supplier` ( + s_acctbal Decimal(12,2) NOT NULL, s_address Utf8 NOT NULL, s_comment Utf8 NOT NULL, s_name Utf8 NOT NULL, - s_nationkey Int32 NOT NULL, -- FK to N_NATIONKEY + s_nationkey Int32 NOT NULL, s_phone Utf8 NOT NULL, - s_suppkey Int64 NOT NULL -- Identifier - , PRIMARY KEY(s_suppkey) + s_suppkey Int64 NOT NULL, + PRIMARY KEY (s_suppkey) ) -PARTITION BY HASH(s_suppkey) -WITH (STORE = COLUMN, --"/supplier/" -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 +PARTITION BY HASH (s_suppkey) +WITH ( + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); Init tables ...Ok diff --git a/ydb/tests/functional/tpc/canondata/test_init.TestTpchInit.test_s1_column_decimal_ydb/s1_column_decimal_ydb b/ydb/tests/functional/tpc/canondata/test_init.TestTpchInit.test_s1_column_decimal_ydb/s1_column_decimal_ydb index ebdef79ab9da..8fa037da2b45 100644 --- a/ydb/tests/functional/tpc/canondata/test_init.TestTpchInit.test_s1_column_decimal_ydb/s1_column_decimal_ydb +++ b/ydb/tests/functional/tpc/canondata/test_init.TestTpchInit.test_s1_column_decimal_ydb/s1_column_decimal_ydb @@ -1,130 +1,137 @@ Init tables ... +--!syntax_v1 - -CREATE TABLE `/Root/db/Root/db/tpch/s1/customer` ( - c_acctbal Decimal(22,9) NOT NULL, -- it should be Decimal(12, 2) +CREATE TABLE `/Root/db/Root/db/tpch/s1/customer` ( + c_acctbal Decimal(22,9) NOT NULL, c_address Utf8 NOT NULL, c_comment Utf8 NOT NULL, - c_custkey Int64 NOT NULL, -- Identifier + c_custkey Int64 NOT NULL, c_mktsegment Utf8 NOT NULL, c_name Utf8 NOT NULL, - c_nationkey Int32 NOT NULL, -- FK to N_NATIONKEY - c_phone Utf8 NOT NULL - , PRIMARY KEY (c_custkey) + c_nationkey Int32 NOT NULL, + c_phone Utf8 NOT NULL, + PRIMARY KEY (c_custkey) ) -PARTITION BY HASH(c_custkey) -WITH (STORE = COLUMN, --"/customer/" -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 +PARTITION BY HASH (c_custkey) +WITH ( + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpch/s1/lineitem` ( +CREATE TABLE `/Root/db/Root/db/tpch/s1/lineitem` ( l_comment Utf8 NOT NULL, l_commitdate Date32 NOT NULL, - l_discount Decimal(22,9) NOT NULL, -- it should be Decimal(12, 2) - l_extendedprice Decimal(22,9) NOT NULL, -- it should be Decimal(12, 2) + l_discount Decimal(22,9) NOT NULL, + l_extendedprice Decimal(22,9) NOT NULL, l_linenumber Int32 NOT NULL, l_linestatus Utf8 NOT NULL, - l_orderkey Int64 NOT NULL, -- FK to O_ORDERKEY - l_partkey Int64 NOT NULL, -- FK to P_PARTKEY, first part of the compound FK to (PS_PARTKEY, PS_SUPPKEY) with L_SUPPKEY - l_quantity Decimal(22,9) NOT NULL, -- it should be Decimal(12, 2) + l_orderkey Int64 NOT NULL, + l_partkey Int64 NOT NULL, + l_quantity Decimal(22,9) NOT NULL, l_receiptdate Date32 NOT NULL, l_returnflag Utf8 NOT NULL, l_shipdate Date32 NOT NULL, l_shipinstruct Utf8 NOT NULL, l_shipmode Utf8 NOT NULL, - l_suppkey Int64 NOT NULL, -- FK to S_SUPPKEY, second part of the compound FK to (PS_PARTKEY, PS_SUPPKEY) with L_PARTKEY - l_tax Decimal(22,9) NOT NULL -- it should be Decimal(12, 2) - , PRIMARY KEY (l_orderkey, l_linenumber) + l_suppkey Int64 NOT NULL, + l_tax Decimal(22,9) NOT NULL, + PRIMARY KEY (l_orderkey, l_linenumber) ) -PARTITION BY HASH(l_orderkey) -WITH (STORE = COLUMN, --"/lineitem/" -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 +PARTITION BY HASH (l_orderkey, l_linenumber) +WITH ( + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpch/s1/nation` ( +CREATE TABLE `/Root/db/Root/db/tpch/s1/nation` ( n_comment Utf8 NOT NULL, n_name Utf8 NOT NULL, - n_nationkey Int32 NOT NULL, -- Identifier - n_regionkey Int32 NOT NULL -- FK to R_REGIONKEY - , PRIMARY KEY(n_nationkey) + n_nationkey Int32 NOT NULL, + n_regionkey Int32 NOT NULL, + PRIMARY KEY (n_nationkey) ) -PARTITION BY HASH(n_nationkey) - -WITH (STORE = COLUMN, --"/nation/" -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 1 +PARTITION BY HASH (n_nationkey) +WITH ( + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 1 ); -CREATE TABLE `/Root/db/Root/db/tpch/s1/orders` ( +CREATE TABLE `/Root/db/Root/db/tpch/s1/orders` ( o_clerk Utf8 NOT NULL, o_comment Utf8 NOT NULL, - o_custkey Int64 NOT NULL, -- FK to C_CUSTKEY + o_custkey Int64 NOT NULL, o_orderdate Date32 NOT NULL, - o_orderkey Int64 NOT NULL, -- Identifier + o_orderkey Int64 NOT NULL, o_orderpriority Utf8 NOT NULL, o_orderstatus Utf8 NOT NULL, o_shippriority Int32 NOT NULL, - o_totalprice Decimal(22,9) NOT NULL -- it should be Decimal(12, 2) - , PRIMARY KEY (o_orderkey) + o_totalprice Decimal(22,9) NOT NULL, + PRIMARY KEY (o_orderkey) ) -PARTITION BY HASH(o_orderkey) -WITH (STORE = COLUMN, --"/orders/" -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 +PARTITION BY HASH (o_orderkey) +WITH ( + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpch/s1/part` ( +CREATE TABLE `/Root/db/Root/db/tpch/s1/part` ( p_brand Utf8 NOT NULL, p_comment Utf8 NOT NULL, p_container Utf8 NOT NULL, p_mfgr Utf8 NOT NULL, p_name Utf8 NOT NULL, - p_partkey Int64 NOT NULL, -- Identifier - p_retailprice Decimal(22,9) NOT NULL, -- it should be Decimal(12, 2) + p_partkey Int64 NOT NULL, + p_retailprice Decimal(22,9) NOT NULL, p_size Int32 NOT NULL, - p_type Utf8 NOT NULL - , PRIMARY KEY(p_partkey) + p_type Utf8 NOT NULL, + PRIMARY KEY (p_partkey) ) -PARTITION BY HASH(p_partkey) -WITH (STORE = COLUMN, --"/part/" -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 +PARTITION BY HASH (p_partkey) +WITH ( + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpch/s1/partsupp` ( +CREATE TABLE `/Root/db/Root/db/tpch/s1/partsupp` ( ps_availqty Int32 NOT NULL, ps_comment Utf8 NOT NULL, - ps_partkey Int64 NOT NULL, -- FK to P_PARTKEY - ps_suppkey Int64 NOT NULL, -- FK to S_SUPPKEY - ps_supplycost Decimal(22,9) NOT NULL -- it should be Decimal(12, 2) - , PRIMARY KEY(ps_partkey, ps_suppkey) + ps_partkey Int64 NOT NULL, + ps_suppkey Int64 NOT NULL, + ps_supplycost Decimal(22,9) NOT NULL, + PRIMARY KEY (ps_partkey) ) -PARTITION BY HASH(ps_partkey) -WITH (STORE = COLUMN, --"/partsupp/" -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 +PARTITION BY HASH (ps_partkey) +WITH ( + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpch/s1/region` ( +CREATE TABLE `/Root/db/Root/db/tpch/s1/region` ( r_comment Utf8 NOT NULL, r_name Utf8 NOT NULL, - r_regionkey Int32 NOT NULL -- Identifier - , PRIMARY KEY(r_regionkey) + r_regionkey Int32 NOT NULL, + PRIMARY KEY (r_regionkey) ) -PARTITION BY HASH(r_regionkey) -WITH (STORE = COLUMN, --"/region/" -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 1 +PARTITION BY HASH (r_regionkey) +WITH ( + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 1 ); -CREATE TABLE `/Root/db/Root/db/tpch/s1/supplier` ( - s_acctbal Decimal(22,9) NOT NULL, -- it should be Decimal(12, 2) +CREATE TABLE `/Root/db/Root/db/tpch/s1/supplier` ( + s_acctbal Decimal(22,9) NOT NULL, s_address Utf8 NOT NULL, s_comment Utf8 NOT NULL, s_name Utf8 NOT NULL, - s_nationkey Int32 NOT NULL, -- FK to N_NATIONKEY + s_nationkey Int32 NOT NULL, s_phone Utf8 NOT NULL, - s_suppkey Int64 NOT NULL -- Identifier - , PRIMARY KEY(s_suppkey) + s_suppkey Int64 NOT NULL, + PRIMARY KEY (s_suppkey) ) -PARTITION BY HASH(s_suppkey) -WITH (STORE = COLUMN, --"/supplier/" -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 +PARTITION BY HASH (s_suppkey) +WITH ( + STORE = COLUMN, + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); Init tables ...Ok diff --git a/ydb/tests/functional/tpc/canondata/test_init.TestTpchInit.test_s1_row/s1_row b/ydb/tests/functional/tpc/canondata/test_init.TestTpchInit.test_s1_row/s1_row index 6eea2998990f..489135684bdd 100644 --- a/ydb/tests/functional/tpc/canondata/test_init.TestTpchInit.test_s1_row/s1_row +++ b/ydb/tests/functional/tpc/canondata/test_init.TestTpchInit.test_s1_row/s1_row @@ -1,130 +1,121 @@ Init tables ... +--!syntax_v1 - -CREATE TABLE `/Root/db/Root/db/tpch/s1/customer` ( - c_acctbal Double , -- it should be Decimal(12, 2) - c_address Utf8 , - c_comment Utf8 , - c_custkey Int64 , -- Identifier - c_mktsegment Utf8 , - c_name Utf8 , - c_nationkey Int32 , -- FK to N_NATIONKEY - c_phone Utf8 - , PRIMARY KEY (c_custkey) +CREATE TABLE `/Root/db/Root/db/tpch/s1/customer` ( + c_acctbal Double, + c_address Utf8, + c_comment Utf8, + c_custkey Int64, + c_mktsegment Utf8, + c_name Utf8, + c_nationkey Int32, + c_phone Utf8, + PRIMARY KEY (c_custkey) ) --- (c_custkey) -WITH (-- "/customer/" -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 +WITH ( + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpch/s1/lineitem` ( - l_comment Utf8 , - l_commitdate Date32 , - l_discount Double , -- it should be Decimal(12, 2) - l_extendedprice Double , -- it should be Decimal(12, 2) - l_linenumber Int32 , - l_linestatus Utf8 , - l_orderkey Int64 , -- FK to O_ORDERKEY - l_partkey Int64 , -- FK to P_PARTKEY, first part of the compound FK to (PS_PARTKEY, PS_SUPPKEY) with L_SUPPKEY - l_quantity Double , -- it should be Decimal(12, 2) - l_receiptdate Date32 , - l_returnflag Utf8 , - l_shipdate Date32 , - l_shipinstruct Utf8 , - l_shipmode Utf8 , - l_suppkey Int64 , -- FK to S_SUPPKEY, second part of the compound FK to (PS_PARTKEY, PS_SUPPKEY) with L_PARTKEY - l_tax Double -- it should be Decimal(12, 2) - , PRIMARY KEY (l_orderkey, l_linenumber) +CREATE TABLE `/Root/db/Root/db/tpch/s1/lineitem` ( + l_comment Utf8, + l_commitdate Date32, + l_discount Double, + l_extendedprice Double, + l_linenumber Int32, + l_linestatus Utf8, + l_orderkey Int64, + l_partkey Int64, + l_quantity Double, + l_receiptdate Date32, + l_returnflag Utf8, + l_shipdate Date32, + l_shipinstruct Utf8, + l_shipmode Utf8, + l_suppkey Int64, + l_tax Double, + PRIMARY KEY (l_orderkey, l_linenumber) ) --- (l_orderkey) -WITH (-- "/lineitem/" -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 +WITH ( + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpch/s1/nation` ( - n_comment Utf8 , - n_name Utf8 , - n_nationkey Int32 , -- Identifier - n_regionkey Int32 -- FK to R_REGIONKEY - , PRIMARY KEY(n_nationkey) +CREATE TABLE `/Root/db/Root/db/tpch/s1/nation` ( + n_comment Utf8, + n_name Utf8, + n_nationkey Int32, + n_regionkey Int32, + PRIMARY KEY (n_nationkey) ) --- (n_nationkey) - -WITH (-- "/nation/" -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 1 +WITH ( + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 1 ); -CREATE TABLE `/Root/db/Root/db/tpch/s1/orders` ( - o_clerk Utf8 , - o_comment Utf8 , - o_custkey Int64 , -- FK to C_CUSTKEY - o_orderdate Date32 , - o_orderkey Int64 , -- Identifier - o_orderpriority Utf8 , - o_orderstatus Utf8 , - o_shippriority Int32 , - o_totalprice Double -- it should be Decimal(12, 2) - , PRIMARY KEY (o_orderkey) +CREATE TABLE `/Root/db/Root/db/tpch/s1/orders` ( + o_clerk Utf8, + o_comment Utf8, + o_custkey Int64, + o_orderdate Date32, + o_orderkey Int64, + o_orderpriority Utf8, + o_orderstatus Utf8, + o_shippriority Int32, + o_totalprice Double, + PRIMARY KEY (o_orderkey) ) --- (o_orderkey) -WITH (-- "/orders/" -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 +WITH ( + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpch/s1/part` ( - p_brand Utf8 , - p_comment Utf8 , - p_container Utf8 , - p_mfgr Utf8 , - p_name Utf8 , - p_partkey Int64 , -- Identifier - p_retailprice Double , -- it should be Decimal(12, 2) - p_size Int32 , - p_type Utf8 - , PRIMARY KEY(p_partkey) +CREATE TABLE `/Root/db/Root/db/tpch/s1/part` ( + p_brand Utf8, + p_comment Utf8, + p_container Utf8, + p_mfgr Utf8, + p_name Utf8, + p_partkey Int64, + p_retailprice Double, + p_size Int32, + p_type Utf8, + PRIMARY KEY (p_partkey) ) --- (p_partkey) -WITH (-- "/part/" -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 +WITH ( + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpch/s1/partsupp` ( - ps_availqty Int32 , - ps_comment Utf8 , - ps_partkey Int64 , -- FK to P_PARTKEY - ps_suppkey Int64 , -- FK to S_SUPPKEY - ps_supplycost Double -- it should be Decimal(12, 2) - , PRIMARY KEY(ps_partkey, ps_suppkey) +CREATE TABLE `/Root/db/Root/db/tpch/s1/partsupp` ( + ps_availqty Int32, + ps_comment Utf8, + ps_partkey Int64, + ps_suppkey Int64, + ps_supplycost Double, + PRIMARY KEY (ps_partkey) ) --- (ps_partkey) -WITH (-- "/partsupp/" -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 +WITH ( + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); -CREATE TABLE `/Root/db/Root/db/tpch/s1/region` ( - r_comment Utf8 , - r_name Utf8 , - r_regionkey Int32 -- Identifier - , PRIMARY KEY(r_regionkey) +CREATE TABLE `/Root/db/Root/db/tpch/s1/region` ( + r_comment Utf8, + r_name Utf8, + r_regionkey Int32, + PRIMARY KEY (r_regionkey) ) --- (r_regionkey) -WITH (-- "/region/" -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 1 +WITH ( + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 1 ); -CREATE TABLE `/Root/db/Root/db/tpch/s1/supplier` ( - s_acctbal Double , -- it should be Decimal(12, 2) - s_address Utf8 , - s_comment Utf8 , - s_name Utf8 , - s_nationkey Int32 , -- FK to N_NATIONKEY - s_phone Utf8 , - s_suppkey Int64 -- Identifier - , PRIMARY KEY(s_suppkey) +CREATE TABLE `/Root/db/Root/db/tpch/s1/supplier` ( + s_acctbal Double, + s_address Utf8, + s_comment Utf8, + s_name Utf8, + s_nationkey Int32, + s_phone Utf8, + s_suppkey Int64, + PRIMARY KEY (s_suppkey) ) --- (s_suppkey) -WITH (-- "/supplier/" -AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 +WITH ( + AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 64 ); Init tables ...Ok diff --git a/ydb/tests/functional/tpc/canondata/test_init.TestTpchInit.test_s1_s3/s1_s3 b/ydb/tests/functional/tpc/canondata/test_init.TestTpchInit.test_s1_s3/s1_s3 index e5b19d5f0178..201c361d97e9 100644 --- a/ydb/tests/functional/tpc/canondata/test_init.TestTpchInit.test_s1_s3/s1_s3 +++ b/ydb/tests/functional/tpc/canondata/test_init.TestTpchInit.test_s1_s3/s1_s3 @@ -1,80 +1,70 @@ Init tables ... - - CREATE EXTERNAL DATA SOURCE `/Root/db/Root/db/tpch/s1_s3_external_source` WITH ( - SOURCE_TYPE="ObjectStorage", - LOCATION="https://storage.yandexcloud.net/tpc", - AUTH_METHOD="NONE" - ); - +--!syntax_v1 +CREATE EXTERNAL DATA SOURCE `/Root/db/Root/db/tpch/s1_s3_external_source` WITH ( + SOURCE_TYPE="ObjectStorage", + LOCATION="https://storage.yandexcloud.net/tpc", + AUTH_METHOD="NONE" +); CREATE EXTERNAL TABLE `/Root/db/Root/db/tpch/s1/customer` ( - c_acctbal Double NOT NULL, -- it should be Decimal(12, 2) + c_acctbal Double NOT NULL, c_address Utf8 NOT NULL, c_comment Utf8 NOT NULL, - c_custkey Int64 NOT NULL, -- Identifier + c_custkey Int64 NOT NULL, c_mktsegment Utf8 NOT NULL, c_name Utf8 NOT NULL, - c_nationkey Int32 NOT NULL, -- FK to N_NATIONKEY + c_nationkey Int32 NOT NULL, c_phone Utf8 NOT NULL - -- (c_custkey) ) --- (c_custkey) -WITH (DATA_SOURCE = "/Root/db/Root/db/tpch/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/customer/" --- = 64 +WITH ( + DATA_SOURCE = "/Root/db/Root/db/tpch/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/customer/" ); CREATE EXTERNAL TABLE `/Root/db/Root/db/tpch/s1/lineitem` ( l_comment Utf8 NOT NULL, l_commitdate Date32 NOT NULL, - l_discount Double NOT NULL, -- it should be Decimal(12, 2) - l_extendedprice Double NOT NULL, -- it should be Decimal(12, 2) + l_discount Double NOT NULL, + l_extendedprice Double NOT NULL, l_linenumber Int32 NOT NULL, l_linestatus Utf8 NOT NULL, - l_orderkey Int64 NOT NULL, -- FK to O_ORDERKEY - l_partkey Int64 NOT NULL, -- FK to P_PARTKEY, first part of the compound FK to (PS_PARTKEY, PS_SUPPKEY) with L_SUPPKEY - l_quantity Double NOT NULL, -- it should be Decimal(12, 2) + l_orderkey Int64 NOT NULL, + l_partkey Int64 NOT NULL, + l_quantity Double NOT NULL, l_receiptdate Date32 NOT NULL, l_returnflag Utf8 NOT NULL, l_shipdate Date32 NOT NULL, l_shipinstruct Utf8 NOT NULL, l_shipmode Utf8 NOT NULL, - l_suppkey Int64 NOT NULL, -- FK to S_SUPPKEY, second part of the compound FK to (PS_PARTKEY, PS_SUPPKEY) with L_PARTKEY - l_tax Double NOT NULL -- it should be Decimal(12, 2) - -- (l_orderkey, l_linenumber) + l_suppkey Int64 NOT NULL, + l_tax Double NOT NULL ) --- (l_orderkey) -WITH (DATA_SOURCE = "/Root/db/Root/db/tpch/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/lineitem/" --- = 64 +WITH ( + DATA_SOURCE = "/Root/db/Root/db/tpch/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/lineitem/" ); CREATE EXTERNAL TABLE `/Root/db/Root/db/tpch/s1/nation` ( n_comment Utf8 NOT NULL, n_name Utf8 NOT NULL, - n_nationkey Int32 NOT NULL, -- Identifier - n_regionkey Int32 NOT NULL -- FK to R_REGIONKEY - --(n_nationkey) + n_nationkey Int32 NOT NULL, + n_regionkey Int32 NOT NULL ) --- (n_nationkey) - -WITH (DATA_SOURCE = "/Root/db/Root/db/tpch/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/nation/" --- = 1 +WITH ( + DATA_SOURCE = "/Root/db/Root/db/tpch/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/nation/" ); CREATE EXTERNAL TABLE `/Root/db/Root/db/tpch/s1/orders` ( o_clerk Utf8 NOT NULL, o_comment Utf8 NOT NULL, - o_custkey Int64 NOT NULL, -- FK to C_CUSTKEY + o_custkey Int64 NOT NULL, o_orderdate Date32 NOT NULL, - o_orderkey Int64 NOT NULL, -- Identifier + o_orderkey Int64 NOT NULL, o_orderpriority Utf8 NOT NULL, o_orderstatus Utf8 NOT NULL, o_shippriority Int32 NOT NULL, - o_totalprice Double NOT NULL -- it should be Decimal(12, 2) - -- (o_orderkey) + o_totalprice Double NOT NULL ) --- (o_orderkey) -WITH (DATA_SOURCE = "/Root/db/Root/db/tpch/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/orders/" --- = 64 +WITH ( + DATA_SOURCE = "/Root/db/Root/db/tpch/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/orders/" ); CREATE EXTERNAL TABLE `/Root/db/Root/db/tpch/s1/part` ( @@ -83,54 +73,46 @@ CREATE EXTERNAL TABLE `/Root/db/Root/db/tpch/s1/part` ( p_container Utf8 NOT NULL, p_mfgr Utf8 NOT NULL, p_name Utf8 NOT NULL, - p_partkey Int64 NOT NULL, -- Identifier - p_retailprice Double NOT NULL, -- it should be Decimal(12, 2) + p_partkey Int64 NOT NULL, + p_retailprice Double NOT NULL, p_size Int32 NOT NULL, p_type Utf8 NOT NULL - --(p_partkey) ) --- (p_partkey) -WITH (DATA_SOURCE = "/Root/db/Root/db/tpch/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/part/" --- = 64 +WITH ( + DATA_SOURCE = "/Root/db/Root/db/tpch/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/part/" ); CREATE EXTERNAL TABLE `/Root/db/Root/db/tpch/s1/partsupp` ( ps_availqty Int32 NOT NULL, ps_comment Utf8 NOT NULL, - ps_partkey Int64 NOT NULL, -- FK to P_PARTKEY - ps_suppkey Int64 NOT NULL, -- FK to S_SUPPKEY - ps_supplycost Double NOT NULL -- it should be Decimal(12, 2) - --(ps_partkey, ps_suppkey) + ps_partkey Int64 NOT NULL, + ps_suppkey Int64 NOT NULL, + ps_supplycost Double NOT NULL ) --- (ps_partkey) -WITH (DATA_SOURCE = "/Root/db/Root/db/tpch/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/partsupp/" --- = 64 +WITH ( + DATA_SOURCE = "/Root/db/Root/db/tpch/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/partsupp/" ); CREATE EXTERNAL TABLE `/Root/db/Root/db/tpch/s1/region` ( r_comment Utf8 NOT NULL, r_name Utf8 NOT NULL, - r_regionkey Int32 NOT NULL -- Identifier - --(r_regionkey) + r_regionkey Int32 NOT NULL ) --- (r_regionkey) -WITH (DATA_SOURCE = "/Root/db/Root/db/tpch/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/region/" --- = 1 +WITH ( + DATA_SOURCE = "/Root/db/Root/db/tpch/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/region/" ); CREATE EXTERNAL TABLE `/Root/db/Root/db/tpch/s1/supplier` ( - s_acctbal Double NOT NULL, -- it should be Decimal(12, 2) + s_acctbal Double NOT NULL, s_address Utf8 NOT NULL, s_comment Utf8 NOT NULL, s_name Utf8 NOT NULL, - s_nationkey Int32 NOT NULL, -- FK to N_NATIONKEY + s_nationkey Int32 NOT NULL, s_phone Utf8 NOT NULL, - s_suppkey Int64 NOT NULL -- Identifier - --(s_suppkey) + s_suppkey Int64 NOT NULL ) --- (s_suppkey) -WITH (DATA_SOURCE = "/Root/db/Root/db/tpch/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/supplier/" --- = 64 +WITH ( + DATA_SOURCE = "/Root/db/Root/db/tpch/s1_s3_external_source", FORMAT = "parquet", LOCATION = "h/s1/parquet/supplier/" ); Init tables ...Ok