From 911ff152ce590aa70b756f512261ee55848a78be Mon Sep 17 00:00:00 2001 From: vlad-gogov Date: Wed, 11 Sep 2024 22:28:10 +0300 Subject: [PATCH 1/6] Update test KqpOlapSysView::DisabledAlterCompression --- ydb/core/kqp/ut/olap/sys_view_ut.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ydb/core/kqp/ut/olap/sys_view_ut.cpp b/ydb/core/kqp/ut/olap/sys_view_ut.cpp index 581384ba4450..aa275ff81d6d 100644 --- a/ydb/core/kqp/ut/olap/sys_view_ut.cpp +++ b/ydb/core/kqp/ut/olap/sys_view_ut.cpp @@ -225,6 +225,9 @@ Y_UNIT_TEST_SUITE(KqpOlapSysView) { TTypedLocalHelper helper("", kikimr, "olapTable", "olapStore"); helper.CreateTestOlapTable(); helper.FillPKOnly(0, 1); + helper.ExecuteSchemeQuery( + "ALTER OBJECT `/Root/olapStore/olapTable` (TYPE TABLE) SET (ACTION=ALTER_COLUMN, NAME=pk_int, " + "`SERIALIZER.CLASS_NAME`=`ARROW_SERIALIZER`, `COMPRESSION.TYPE`=`zstd`);", NYdb::EStatus::SCHEME_ERROR); helper.ExecuteSchemeQuery( "ALTER OBJECT `/Root/olapStore` (TYPE TABLESTORE) SET (ACTION=ALTER_COLUMN, NAME=pk_int, " "`SERIALIZER.CLASS_NAME`=`ARROW_SERIALIZER`, `COMPRESSION.TYPE`=`zstd`);", NYdb::EStatus::PRECONDITION_FAILED); From aa80897f0fbb902622f5579fcacc08c1fe70dff6 Mon Sep 17 00:00:00 2001 From: vlad-gogov Date: Fri, 13 Sep 2024 09:55:21 +0300 Subject: [PATCH 2/6] add test --- ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp b/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp index 4195c6a64244..a8c895917474 100644 --- a/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp +++ b/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp @@ -8326,6 +8326,24 @@ Y_UNIT_TEST_SUITE(KqpOlapScheme) { testHelper.CreateTable(testTable, EStatus::SCHEME_ERROR); } + Y_UNIT_TEST(DisabledAlterCompression) { + TKikimrSettings runnerSettings = TKikimrSettings().SetWithSampleTables(false).SetEnableOlapCompression(false); + TTestHelper testHelper(runnerSettings); + TVector schema = { + TTestHelper::TColumnSchema().SetName("id").SetType(NScheme::NTypeIds::Uint64).SetNullable(false) + }; + + TTestHelper::TColumnTable testTable; + testTable.SetName("/Root/ColumnTableTest").SetPrimaryKey({ "id" }).SetSharding({ "id" }).SetSchema(schema); + testHelper.CreateTable(testTable); + + auto alterResult = testHelper.GetSession() + .ExecuteSchemeQuery( + "ALTER OBJECT `/Root/ColumnTableTest` (TYPE TABLE) SET (ACTION=ALTER_COLUMN, " + "NAME=id,`SERIALIZER.CLASS_NAME`=`ARROW_SERIALIZER`, `COMPRESSION.TYPE`=`zstd`);") + .GetValueSync(); + UNIT_ASSERT_VALUES_EQUAL_C(alterResult.GetStatus(), EStatus::SCHEME_ERROR, alterResult.GetIssues().ToString()); + } } Y_UNIT_TEST_SUITE(KqpOlapTypes) { From 8c0d30277de4bde3f43cd4e3b452161ba1816d07 Mon Sep 17 00:00:00 2001 From: vlad-gogov Date: Mon, 16 Sep 2024 10:41:46 +0300 Subject: [PATCH 3/6] test moved in compression_ut --- ydb/core/kqp/ut/olap/compression_ut.cpp | 42 ++++++++++++++++++++++++ ydb/core/kqp/ut/olap/sys_view_ut.cpp | 14 -------- ydb/core/kqp/ut/olap/ya.make | 1 + ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp | 19 ----------- 4 files changed, 43 insertions(+), 33 deletions(-) create mode 100644 ydb/core/kqp/ut/olap/compression_ut.cpp diff --git a/ydb/core/kqp/ut/olap/compression_ut.cpp b/ydb/core/kqp/ut/olap/compression_ut.cpp new file mode 100644 index 000000000000..9811e407cc7d --- /dev/null +++ b/ydb/core/kqp/ut/olap/compression_ut.cpp @@ -0,0 +1,42 @@ +#include "helpers/typed_local.h" + +#include + +namespace NKikimr::NKqp { + +Y_UNIT_TEST_SUITE(KqpOlapCompression) { + Y_UNIT_TEST(DisabledAlterCompression) { + TKikimrSettings settings = TKikimrSettings().SetWithSampleTables(false).SetEnableOlapCompression(false); + { + TKikimrRunner kikimr(settings); + TTypedLocalHelper helper("", kikimr, "olapTable", "olapStore"); + helper.CreateTestOlapTable(); + helper.FillPKOnly(0, 1); + helper.ExecuteSchemeQuery( + "ALTER OBJECT `/Root/olapStore/olapTable` (TYPE TABLE) SET (ACTION=ALTER_COLUMN, NAME=pk_int, " + "`SERIALIZER.CLASS_NAME`=`ARROW_SERIALIZER`, `COMPRESSION.TYPE`=`zstd`);", NYdb::EStatus::SCHEME_ERROR); + helper.ExecuteSchemeQuery( + "ALTER OBJECT `/Root/olapStore` (TYPE TABLESTORE) SET (ACTION=ALTER_COLUMN, NAME=pk_int, " + "`SERIALIZER.CLASS_NAME`=`ARROW_SERIALIZER`, `COMPRESSION.TYPE`=`zstd`);", NYdb::EStatus::PRECONDITION_FAILED); + } + + { + TTestHelper helper(settings); + TVector schema = { + TTestHelper::TColumnSchema().SetName("pk_int").SetType(NScheme::NTypeIds::Uint64).SetNullable(false) + }; + + TTestHelper::TColumnTable table; + table.SetName("/Root/olapTable").SetPrimaryKey({ "pk_int" }).SetSharding({ "pk_int" }).SetSchema(schema); + helper.CreateTable(table); + + auto alterResult = helper.GetSession() + .ExecuteSchemeQuery( + "ALTER OBJECT `/Root/olapTable` (TYPE TABLE) SET (ACTION=ALTER_COLUMN, " + "NAME=pk_int,`SERIALIZER.CLASS_NAME`=`ARROW_SERIALIZER`, `COMPRESSION.TYPE`=`zstd`);") + .GetValueSync(); + UNIT_ASSERT_VALUES_EQUAL_C(alterResult.GetStatus(), NYdb::EStatus::SCHEME_ERROR, alterResult.GetIssues().ToString()); + } + } +} +} diff --git a/ydb/core/kqp/ut/olap/sys_view_ut.cpp b/ydb/core/kqp/ut/olap/sys_view_ut.cpp index aa275ff81d6d..27820452542e 100644 --- a/ydb/core/kqp/ut/olap/sys_view_ut.cpp +++ b/ydb/core/kqp/ut/olap/sys_view_ut.cpp @@ -219,20 +219,6 @@ Y_UNIT_TEST_SUITE(KqpOlapSysView) { } } - Y_UNIT_TEST(DisabledAlterCompression) { - TKikimrSettings settings = TKikimrSettings().SetWithSampleTables(false).SetEnableOlapCompression(false); - TKikimrRunner kikimr(settings); - TTypedLocalHelper helper("", kikimr, "olapTable", "olapStore"); - helper.CreateTestOlapTable(); - helper.FillPKOnly(0, 1); - helper.ExecuteSchemeQuery( - "ALTER OBJECT `/Root/olapStore/olapTable` (TYPE TABLE) SET (ACTION=ALTER_COLUMN, NAME=pk_int, " - "`SERIALIZER.CLASS_NAME`=`ARROW_SERIALIZER`, `COMPRESSION.TYPE`=`zstd`);", NYdb::EStatus::SCHEME_ERROR); - helper.ExecuteSchemeQuery( - "ALTER OBJECT `/Root/olapStore` (TYPE TABLESTORE) SET (ACTION=ALTER_COLUMN, NAME=pk_int, " - "`SERIALIZER.CLASS_NAME`=`ARROW_SERIALIZER`, `COMPRESSION.TYPE`=`zstd`);", NYdb::EStatus::PRECONDITION_FAILED); - } - Y_UNIT_TEST(StatsSysViewBytesColumnActualization) { ui64 rawBytes1; ui64 bytes1; diff --git a/ydb/core/kqp/ut/olap/ya.make b/ydb/core/kqp/ut/olap/ya.make index e324116597eb..92ec60d6a8b8 100644 --- a/ydb/core/kqp/ut/olap/ya.make +++ b/ydb/core/kqp/ut/olap/ya.make @@ -26,6 +26,7 @@ SRCS( sparsed_ut.cpp tiering_ut.cpp decimal_ut.cpp + compression_ut.cpp ) PEERDIR( diff --git a/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp b/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp index a8c895917474..f22c75d799db 100644 --- a/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp +++ b/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp @@ -8325,25 +8325,6 @@ Y_UNIT_TEST_SUITE(KqpOlapScheme) { testTable.SetName("/Root/ColumnTableTest").SetPrimaryKey({"id"}).SetSchema(schema); testHelper.CreateTable(testTable, EStatus::SCHEME_ERROR); } - - Y_UNIT_TEST(DisabledAlterCompression) { - TKikimrSettings runnerSettings = TKikimrSettings().SetWithSampleTables(false).SetEnableOlapCompression(false); - TTestHelper testHelper(runnerSettings); - TVector schema = { - TTestHelper::TColumnSchema().SetName("id").SetType(NScheme::NTypeIds::Uint64).SetNullable(false) - }; - - TTestHelper::TColumnTable testTable; - testTable.SetName("/Root/ColumnTableTest").SetPrimaryKey({ "id" }).SetSharding({ "id" }).SetSchema(schema); - testHelper.CreateTable(testTable); - - auto alterResult = testHelper.GetSession() - .ExecuteSchemeQuery( - "ALTER OBJECT `/Root/ColumnTableTest` (TYPE TABLE) SET (ACTION=ALTER_COLUMN, " - "NAME=id,`SERIALIZER.CLASS_NAME`=`ARROW_SERIALIZER`, `COMPRESSION.TYPE`=`zstd`);") - .GetValueSync(); - UNIT_ASSERT_VALUES_EQUAL_C(alterResult.GetStatus(), EStatus::SCHEME_ERROR, alterResult.GetIssues().ToString()); - } } Y_UNIT_TEST_SUITE(KqpOlapTypes) { From a39443857acf37226a2a2e4538e33070e5ffdb61 Mon Sep 17 00:00:00 2001 From: vlad-gogov Date: Mon, 16 Sep 2024 10:46:17 +0300 Subject: [PATCH 4/6] fix --- ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp b/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp index f22c75d799db..4195c6a64244 100644 --- a/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp +++ b/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp @@ -8325,6 +8325,7 @@ Y_UNIT_TEST_SUITE(KqpOlapScheme) { testTable.SetName("/Root/ColumnTableTest").SetPrimaryKey({"id"}).SetSchema(schema); testHelper.CreateTable(testTable, EStatus::SCHEME_ERROR); } + } Y_UNIT_TEST_SUITE(KqpOlapTypes) { From b7ae6b199a53df7e4a9a3ad0a6988539b292868d Mon Sep 17 00:00:00 2001 From: vlad-gogov Date: Mon, 16 Sep 2024 14:26:38 +0300 Subject: [PATCH 5/6] Added additional functional in TTestHelper and refactoring test KqpOlapCompression::DisabledAlterCompression --- ydb/core/kqp/ut/common/columnshard.cpp | 21 +++- ydb/core/kqp/ut/common/columnshard.h | 146 +++++++++++++----------- ydb/core/kqp/ut/olap/compression_ut.cpp | 46 +++----- 3 files changed, 117 insertions(+), 96 deletions(-) diff --git a/ydb/core/kqp/ut/common/columnshard.cpp b/ydb/core/kqp/ut/common/columnshard.cpp index fa68d4a84ffa..d00ccf2044e8 100644 --- a/ydb/core/kqp/ut/common/columnshard.cpp +++ b/ydb/core/kqp/ut/common/columnshard.cpp @@ -1,6 +1,8 @@ #include "columnshard.h" -#include + #include +#include +#include extern "C" { #include @@ -143,6 +145,13 @@ namespace NKqp { } } + void TTestHelper::SetCompression( + const TColumnTableBase& columnTable, const TString& columnName, const TCompression& compression, const NYdb::EStatus expectedStatus) { + auto alterQuery = columnTable.BuildAlterCompressionQuery(columnName, compression); + auto result = GetSession().ExecuteSchemeQuery(alterQuery).GetValueSync(); + UNIT_ASSERT_VALUES_EQUAL_C(result.GetStatus(), expectedStatus, result.GetIssues().ToString()); + } + TString TTestHelper::TColumnSchema::BuildQuery() const { TStringBuilder str; str << Name << ' '; @@ -185,6 +194,16 @@ namespace NKqp { return str; } + TString TTestHelper::TColumnTableBase::BuildAlterCompressionQuery(const TString& columnName, const TCompression& compression) const { + auto str = TStringBuilder() << "ALTER OBJECT `" << Name << "` (TYPE " << GetObjectType() << ") SET"; + str << " (ACTION=ALTER_COLUMN, NAME=" << columnName << ", `SERIALIZER.CLASS_NAME`=`" << compression.GetSerializerName() << "`,"; + str << " `COMPRESSION.TYPE`=`" << NArrow::CompressionToString(compression.GetType()) << "`"; + if (compression.GetCompressionLevel() != Max()) { + str << "`COMPRESSION.LEVEL`=" << compression.GetCompressionLevel(); + } + str << ");"; + return str; + } std::shared_ptr TTestHelper::TColumnTableBase::GetArrowSchema(const TVector& columns) { std::vector> result; diff --git a/ydb/core/kqp/ut/common/columnshard.h b/ydb/core/kqp/ut/common/columnshard.h index 83dd86d3d98b..df41d22f1813 100644 --- a/ydb/core/kqp/ut/common/columnshard.h +++ b/ydb/core/kqp/ut/common/columnshard.h @@ -1,88 +1,102 @@ #pragma once #include "kqp_ut_common.h" + +#include + #include -#include #include #include +#include #include #include #include -#include #include namespace NKikimr { namespace NKqp { - class TTestHelper { +class TTestHelper { +public: + class TCompression { + YDB_ACCESSOR(TString, SerializerName, "ARROW_SERIALIZER"); + YDB_ACCESSOR(arrow::Compression::type, Type, arrow::Compression::type::UNCOMPRESSED); + YDB_ACCESSOR(i32, CompressionLevel, Max()); + }; + + class TColumnSchema { + YDB_ACCESSOR_DEF(TString, Name); + YDB_ACCESSOR_DEF(NScheme::TTypeInfo, TypeDesc); + YDB_FLAG_ACCESSOR(Nullable, true); + public: - class TColumnSchema { - YDB_ACCESSOR_DEF(TString, Name); - YDB_ACCESSOR_DEF(NScheme::TTypeInfo, TypeInfo); - YDB_FLAG_ACCESSOR(Nullable, true); - public: - TString BuildQuery() const; - - TColumnSchema& SetType(NScheme::TTypeId typeId); - }; - - using TUpdatesBuilder = NColumnShard::TTableUpdatesBuilder; - - class TColumnTableBase { - YDB_ACCESSOR_DEF(TString, Name); - YDB_ACCESSOR_DEF(TVector, Schema); - YDB_ACCESSOR_DEF(TVector, PrimaryKey); - YDB_ACCESSOR_DEF(TVector, Sharding); - YDB_ACCESSOR(ui32, MinPartitionsCount, 1); - - std::optional> TTLConf; - public: - TString BuildQuery() const; - std::shared_ptr GetArrowSchema(const TVector& columns); - - TColumnTableBase& SetTTL(const TString& columnName, const TString& ttlConf) { - TTLConf = std::make_pair(columnName, ttlConf); - return *this; - } - - private: - virtual TString GetObjectType() const = 0; - TString BuildColumnsStr(const TVector& clumns) const; - std::shared_ptr BuildField(const TString name, const NScheme::TTypeInfo& typeInfo, bool nullable) const; - }; - - class TColumnTable : public TColumnTableBase { - private: - TString GetObjectType() const override; - }; - - class TColumnTableStore : public TColumnTableBase { - private: - TString GetObjectType() const override; - }; + TString BuildQuery() const; - private: - std::unique_ptr Kikimr; - std::unique_ptr TableClient; - std::unique_ptr Session; + TColumnSchema& SetType(NScheme::TTypeId typeId); + }; + + using TUpdatesBuilder = NColumnShard::TTableUpdatesBuilder; + + class TColumnTableBase { + YDB_ACCESSOR_DEF(TString, Name); + YDB_ACCESSOR_DEF(TVector, Schema); + YDB_ACCESSOR_DEF(TVector, PrimaryKey); + YDB_ACCESSOR_DEF(TVector, Sharding); + YDB_ACCESSOR(ui32, MinPartitionsCount, 1); + + std::optional> TTLConf; public: - TTestHelper(const TKikimrSettings& settings); - TKikimrRunner& GetKikimr(); - TTestActorRuntime& GetRuntime(); - NYdb::NTable::TSession& GetSession(); - void CreateTable(const TColumnTableBase& table, const NYdb::EStatus expectedStatus = NYdb::EStatus::SUCCESS); - void DropTable(const TString& tableName); - void CreateTier(const TString& tierName); - TString CreateTieringRule(const TString& tierName, const TString& columnName); - void SetTiering(const TString& tableName, const TString& ruleName); - void ResetTiering(const TString& tableName); - void BulkUpsert(const TColumnTable& table, TTestHelper::TUpdatesBuilder& updates, const Ydb::StatusIds_StatusCode& opStatus = Ydb::StatusIds::SUCCESS); - void BulkUpsert(const TColumnTable& table, std::shared_ptr batch, const Ydb::StatusIds_StatusCode& opStatus = Ydb::StatusIds::SUCCESS); - void ReadData(const TString& query, const TString& expected, const NYdb::EStatus opStatus = NYdb::EStatus::SUCCESS); - void RebootTablets(const TString& tableName); - void WaitTabletDeletionInHive(ui64 tabletId, TDuration duration); + TString BuildQuery() const; + TString BuildAlterCompressionQuery(const TString& columnName, const TCompression& compression) const; + std::shared_ptr GetArrowSchema(const TVector& columns); + + TColumnTableBase& SetTTL(const TString& columnName, const TString& ttlConf) { + TTLConf = std::make_pair(columnName, ttlConf); + return *this; + } + + private: + virtual TString GetObjectType() const = 0; + TString BuildColumnsStr(const TVector& clumns) const; + std::shared_ptr BuildField(const TString name, const NScheme::TTypeId typeId, void* const typeDesc, bool nullable) const; + }; + + class TColumnTable: public TColumnTableBase { + private: + TString GetObjectType() const override; + }; + + class TColumnTableStore: public TColumnTableBase { + private: + TString GetObjectType() const override; }; +private: + std::unique_ptr Kikimr; + std::unique_ptr TableClient; + std::unique_ptr Session; + +public: + TTestHelper(const TKikimrSettings& settings); + TKikimrRunner& GetKikimr(); + TTestActorRuntime& GetRuntime(); + NYdb::NTable::TSession& GetSession(); + void CreateTable(const TColumnTableBase& table, const NYdb::EStatus expectedStatus = NYdb::EStatus::SUCCESS); + void DropTable(const TString& tableName); + void CreateTier(const TString& tierName); + TString CreateTieringRule(const TString& tierName, const TString& columnName); + void SetTiering(const TString& tableName, const TString& ruleName); + void ResetTiering(const TString& tableName); + void BulkUpsert( + const TColumnTable& table, TTestHelper::TUpdatesBuilder& updates, const Ydb::StatusIds_StatusCode& opStatus = Ydb::StatusIds::SUCCESS); + void BulkUpsert(const TColumnTable& table, std::shared_ptr batch, + const Ydb::StatusIds_StatusCode& opStatus = Ydb::StatusIds::SUCCESS); + void ReadData(const TString& query, const TString& expected, const NYdb::EStatus opStatus = NYdb::EStatus::SUCCESS); + void RebootTablets(const TString& tableName); + void WaitTabletDeletionInHive(ui64 tabletId, TDuration duration); + void SetCompression(const TColumnTableBase& columnTable, const TString& columnName, const TCompression& compression, + const NYdb::EStatus expectedStatus = NYdb::EStatus::SUCCESS); +}; } } diff --git a/ydb/core/kqp/ut/olap/compression_ut.cpp b/ydb/core/kqp/ut/olap/compression_ut.cpp index 9811e407cc7d..3745809b05c5 100644 --- a/ydb/core/kqp/ut/olap/compression_ut.cpp +++ b/ydb/core/kqp/ut/olap/compression_ut.cpp @@ -1,5 +1,3 @@ -#include "helpers/typed_local.h" - #include namespace NKikimr::NKqp { @@ -7,36 +5,26 @@ namespace NKikimr::NKqp { Y_UNIT_TEST_SUITE(KqpOlapCompression) { Y_UNIT_TEST(DisabledAlterCompression) { TKikimrSettings settings = TKikimrSettings().SetWithSampleTables(false).SetEnableOlapCompression(false); - { - TKikimrRunner kikimr(settings); - TTypedLocalHelper helper("", kikimr, "olapTable", "olapStore"); - helper.CreateTestOlapTable(); - helper.FillPKOnly(0, 1); - helper.ExecuteSchemeQuery( - "ALTER OBJECT `/Root/olapStore/olapTable` (TYPE TABLE) SET (ACTION=ALTER_COLUMN, NAME=pk_int, " - "`SERIALIZER.CLASS_NAME`=`ARROW_SERIALIZER`, `COMPRESSION.TYPE`=`zstd`);", NYdb::EStatus::SCHEME_ERROR); - helper.ExecuteSchemeQuery( - "ALTER OBJECT `/Root/olapStore` (TYPE TABLESTORE) SET (ACTION=ALTER_COLUMN, NAME=pk_int, " - "`SERIALIZER.CLASS_NAME`=`ARROW_SERIALIZER`, `COMPRESSION.TYPE`=`zstd`);", NYdb::EStatus::PRECONDITION_FAILED); - } + TTestHelper testHelper(settings); + TVector schema = { + TTestHelper::TColumnSchema().SetName("pk_int").SetType(NScheme::NTypeIds::Uint64).SetNullable(false) + }; + TTestHelper::TCompression compression = TTestHelper::TCompression().SetType(arrow::Compression::type::ZSTD); - { - TTestHelper helper(settings); - TVector schema = { - TTestHelper::TColumnSchema().SetName("pk_int").SetType(NScheme::NTypeIds::Uint64).SetNullable(false) - }; + TTestHelper::TColumnTable standaloneTable; + standaloneTable.SetName("/Root/StandaloneTable").SetPrimaryKey({ "pk_int" }).SetSharding({ "pk_int" }).SetSchema(schema); + testHelper.CreateTable(standaloneTable); + testHelper.SetCompression(standaloneTable, "pk_int", compression, NYdb::EStatus::SCHEME_ERROR); - TTestHelper::TColumnTable table; - table.SetName("/Root/olapTable").SetPrimaryKey({ "pk_int" }).SetSharding({ "pk_int" }).SetSchema(schema); - helper.CreateTable(table); + TTestHelper::TColumnTableStore testTableStore; + testTableStore.SetName("/Root/TableStoreTest").SetPrimaryKey({ "pk_int" }).SetSchema(schema); + testHelper.CreateTable(testTableStore); + testHelper.SetCompression(testTableStore, "pk_int", compression, NYdb::EStatus::PRECONDITION_FAILED); - auto alterResult = helper.GetSession() - .ExecuteSchemeQuery( - "ALTER OBJECT `/Root/olapTable` (TYPE TABLE) SET (ACTION=ALTER_COLUMN, " - "NAME=pk_int,`SERIALIZER.CLASS_NAME`=`ARROW_SERIALIZER`, `COMPRESSION.TYPE`=`zstd`);") - .GetValueSync(); - UNIT_ASSERT_VALUES_EQUAL_C(alterResult.GetStatus(), NYdb::EStatus::SCHEME_ERROR, alterResult.GetIssues().ToString()); - } + TTestHelper::TColumnTable testTable; + testTable.SetName("/Root/TableStoreTest/ColumnTableTest").SetPrimaryKey({ "pk_int" }).SetSharding({ "pk_int" }).SetSchema(schema); + testHelper.CreateTable(testTable); + testHelper.SetCompression(testTable, "pk_int", compression, NYdb::EStatus::SCHEME_ERROR); } } } From e677ae3e124bc0096f270abbb9c38a04bda7ff14 Mon Sep 17 00:00:00 2001 From: vlad-gogov Date: Mon, 16 Sep 2024 16:13:18 +0300 Subject: [PATCH 6/6] fix rebae --- ydb/core/kqp/ut/common/columnshard.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ydb/core/kqp/ut/common/columnshard.h b/ydb/core/kqp/ut/common/columnshard.h index df41d22f1813..8c4bc0fed6fd 100644 --- a/ydb/core/kqp/ut/common/columnshard.h +++ b/ydb/core/kqp/ut/common/columnshard.h @@ -26,7 +26,7 @@ class TTestHelper { class TColumnSchema { YDB_ACCESSOR_DEF(TString, Name); - YDB_ACCESSOR_DEF(NScheme::TTypeInfo, TypeDesc); + YDB_ACCESSOR_DEF(NScheme::TTypeInfo, TypeInfo); YDB_FLAG_ACCESSOR(Nullable, true); public: @@ -59,7 +59,7 @@ class TTestHelper { private: virtual TString GetObjectType() const = 0; TString BuildColumnsStr(const TVector& clumns) const; - std::shared_ptr BuildField(const TString name, const NScheme::TTypeId typeId, void* const typeDesc, bool nullable) const; + std::shared_ptr BuildField(const TString name, const NScheme::TTypeInfo& typeInfo, bool nullable) const; }; class TColumnTable: public TColumnTableBase {