Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added muted test "KqpOlapScheme.DropColumnAfterInsert". #9898

Merged
merged 3 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/config/muted_ya.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 [*/*]*
Expand Down
82 changes: 9 additions & 73 deletions ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<NOlap::TWaitCompactionController>();
Expand All @@ -8337,7 +8337,8 @@ Y_UNIT_TEST_SUITE(KqpOlapScheme) {
TTestHelper testHelper(runnerSettings);

TVector<TTestHelper::TColumnSchema> 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;
Expand All @@ -8347,80 +8348,15 @@ Y_UNIT_TEST_SUITE(KqpOlapScheme) {
TVector<NConstruction::IArrayBuilder::TPtr> dataBuilders;
dataBuilders.push_back(
NConstruction::TSimpleArrayConstructor<NConstruction::TIntSeqFiller<arrow::UInt64Type>>::BuildNotNullable("id", false));
dataBuilders.push_back(
std::make_shared<NConstruction::TSimpleArrayConstructor<NConstruction::TIntSeqFiller<arrow::Int32Type>>>("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));
Expand Down