diff --git a/.github/config/muted_ya.txt b/.github/config/muted_ya.txt index e4dc57fa9b6e..6a0ed1ba02c2 100644 --- a/.github/config/muted_ya.txt +++ b/.github/config/muted_ya.txt @@ -19,7 +19,7 @@ ydb/core/kqp/ut/query KqpQuery.QueryTimeout ydb/core/kqp/ut/scan KqpRequestContext.TraceIdInErrorMessage ydb/core/kqp/ut/scheme [*/*]* ydb/core/kqp/ut/scheme KqpOlapScheme.TenThousandColumns -ydb/core/kqp/ut/scheme KqpOlapScheme.DropColumnAfterScan +ydb/core/kqp/ut/scheme KqpOlapScheme.DropColumnAfterInsert ydb/core/kqp/ut/scheme KqpScheme.AlterAsyncReplication ydb/core/kqp/ut/scheme KqpScheme.QueryWithAlter ydb/core/kqp/ut/service [*/*]* diff --git a/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp b/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp index f7d32dd1f5d9..3362c381db33 100644 --- a/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp +++ b/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp @@ -8326,7 +8326,7 @@ Y_UNIT_TEST_SUITE(KqpOlapScheme) { testHelper.CreateTable(testTable, EStatus::SCHEME_ERROR); } - Y_UNIT_TEST(DropColumnAfterScan) { + Y_UNIT_TEST(DropColumnAfterInsert) { using namespace NArrow; auto csController = NYDBTest::TControllers::RegisterCSControllerGuard(); @@ -8337,7 +8337,8 @@ Y_UNIT_TEST_SUITE(KqpOlapScheme) { TTestHelper testHelper(runnerSettings); TVector schema = { - TTestHelper::TColumnSchema().SetName("id").SetType(NScheme::NTypeIds::Uint64).SetNullable(false) + TTestHelper::TColumnSchema().SetName("id").SetType(NScheme::NTypeIds::Uint64).SetNullable(false), + TTestHelper::TColumnSchema().SetName("int_column").SetType(NScheme::NTypeIds::Int32).SetNullable(true) }; TTestHelper::TColumnTable testTable; @@ -8347,80 +8348,15 @@ Y_UNIT_TEST_SUITE(KqpOlapScheme) { TVector dataBuilders; dataBuilders.push_back( NConstruction::TSimpleArrayConstructor>::BuildNotNullable("id", false)); + dataBuilders.push_back( + std::make_shared>>("int_column")); auto batch = NConstruction::TRecordBatchConstructor(dataBuilders).BuildBatch(100); testHelper.BulkUpsert(testTable, batch); - { - auto alterQueryAdd = TStringBuilder() - << "ALTER TABLE `" << testTable.GetName() << "` ADD COLUMN column" << schema.size() + 1 << " Uint64;"; - Cerr << alterQueryAdd << Endl; - auto alterAddResult = testHelper.GetSession().ExecuteSchemeQuery(alterQueryAdd).GetValueSync(); - UNIT_ASSERT_VALUES_EQUAL_C(alterAddResult.GetStatus(), EStatus::SUCCESS, alterAddResult.GetIssues().ToString()); - - testHelper.BulkUpsert(testTable, batch); - testHelper.ReadData("SELECT COUNT(*) FROM `/Root/ColumnTableTest`", "[[100u]]"); - - auto alterQueryDrop = TStringBuilder() - << "ALTER TABLE `" << testTable.GetName() << "` DROP COLUMN column" << schema.size() + 1 << ";"; - Cerr << alterQueryDrop << Endl; - auto alterDropResult = testHelper.GetSession().ExecuteSchemeQuery(alterQueryDrop).GetValueSync(); - UNIT_ASSERT_VALUES_EQUAL_C(alterDropResult.GetStatus(), EStatus::SUCCESS, alterDropResult.GetIssues().ToString()); - testHelper.ReadData("SELECT COUNT(*) FROM `/Root/ColumnTableTest`", "[[100u]]"); - } - - { - auto alterQueryAdd = TStringBuilder() - << "ALTER TABLE `" << testTable.GetName() << "` ADD COLUMN column" << schema.size() + 1 << " Uint64;"; - Cerr << alterQueryAdd << Endl; - auto alterAddResult = testHelper.GetSession().ExecuteSchemeQuery(alterQueryAdd).GetValueSync(); - UNIT_ASSERT_VALUES_EQUAL_C(alterAddResult.GetStatus(), EStatus::SUCCESS, alterAddResult.GetIssues().ToString()); - - testHelper.BulkUpsert(testTable, batch); - testHelper.ReadData("SELECT COUNT(*) FROM `/Root/ColumnTableTest`", "[[100u]]"); - - auto alterQueryDrop = TStringBuilder() - << "ALTER TABLE `" << testTable.GetName() << "` DROP COLUMN column" << schema.size() + 1 << ";"; - Cerr << alterQueryDrop << Endl; - auto alterDropResult = testHelper.GetSession().ExecuteSchemeQuery(alterQueryDrop).GetValueSync(); - UNIT_ASSERT_VALUES_EQUAL_C(alterDropResult.GetStatus(), EStatus::SUCCESS, alterDropResult.GetIssues().ToString()); - testHelper.ReadData("SELECT COUNT(*) FROM `/Root/ColumnTableTest`", "[[100u]]"); - } - - { - auto alterQueryAdd = TStringBuilder() - << "ALTER TABLE `" << testTable.GetName() << "` ADD COLUMN column" << schema.size() + 1 << " Uint64;"; - Cerr << alterQueryAdd << Endl; - auto alterAddResult = testHelper.GetSession().ExecuteSchemeQuery(alterQueryAdd).GetValueSync(); - UNIT_ASSERT_VALUES_EQUAL_C(alterAddResult.GetStatus(), EStatus::SUCCESS, alterAddResult.GetIssues().ToString()); - - testHelper.BulkUpsert(testTable, batch); - testHelper.ReadData("SELECT COUNT(*) FROM `/Root/ColumnTableTest`", "[[100u]]"); - - auto alterQueryDrop = TStringBuilder() - << "ALTER TABLE `" << testTable.GetName() << "` DROP COLUMN column" << schema.size() + 1 << ";"; - Cerr << alterQueryDrop << Endl; - auto alterDropResult = testHelper.GetSession().ExecuteSchemeQuery(alterQueryDrop).GetValueSync(); - UNIT_ASSERT_VALUES_EQUAL_C(alterDropResult.GetStatus(), EStatus::SUCCESS, alterDropResult.GetIssues().ToString()); - testHelper.ReadData("SELECT COUNT(*) FROM `/Root/ColumnTableTest`", "[[100u]]"); - } - - { - auto alterQueryAdd = TStringBuilder() - << "ALTER TABLE `" << testTable.GetName() << "` ADD COLUMN column" << schema.size() + 1 << " Uint64;"; - Cerr << alterQueryAdd << Endl; - auto alterAddResult = testHelper.GetSession().ExecuteSchemeQuery(alterQueryAdd).GetValueSync(); - UNIT_ASSERT_VALUES_EQUAL_C(alterAddResult.GetStatus(), EStatus::SUCCESS, alterAddResult.GetIssues().ToString()); - - testHelper.BulkUpsert(testTable, batch); - testHelper.ReadData("SELECT COUNT(*) FROM `/Root/ColumnTableTest`", "[[100u]]"); - - auto alterQueryDrop = TStringBuilder() - << "ALTER TABLE `" << testTable.GetName() << "` DROP COLUMN column" << schema.size() + 1 << ";"; - Cerr << alterQueryDrop << Endl; - auto alterDropResult = testHelper.GetSession().ExecuteSchemeQuery(alterQueryDrop).GetValueSync(); - UNIT_ASSERT_VALUES_EQUAL_C(alterDropResult.GetStatus(), EStatus::SUCCESS, alterDropResult.GetIssues().ToString()); - testHelper.ReadData("SELECT COUNT(*) FROM `/Root/ColumnTableTest`", "[[100u]]"); - } + auto alterQueryAdd = TStringBuilder() << "ALTER TABLE `" << testTable.GetName() << "` DROP COLUMN int_column;"; + Cerr << alterQueryAdd << Endl; + auto alterAddResult = testHelper.GetSession().ExecuteSchemeQuery(alterQueryAdd).GetValueSync(); + UNIT_ASSERT_VALUES_EQUAL_C(alterAddResult.GetStatus(), EStatus::SUCCESS, alterAddResult.GetIssues().ToString()); csController->EnableBackground(NYDBTest::ICSController::EBackground::Indexation); csController->WaitIndexation(TDuration::Seconds(5));