Skip to content

Commit

Permalink
Merge 38fb5e2 into 66e070c
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanmorozov333 authored Oct 5, 2024
2 parents 66e070c + 38fb5e2 commit bfb90f6
Show file tree
Hide file tree
Showing 72 changed files with 1,286 additions and 478 deletions.
2 changes: 2 additions & 0 deletions ydb/core/kqp/ut/common/kqp_ut_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ struct TKikimrSettings: public TTestFeatureFlagsHolder<TKikimrSettings> {
exchangerSettings->SetMaxDelayMs(10);
AppConfig.MutableColumnShardConfig()->SetDisabledOnSchemeShard(false);
FeatureFlags.SetEnableSparsedColumns(true);
FeatureFlags.SetEnableImmediateWritingOnBulkUpsert(true);
FeatureFlags.SetEnableWritePortionsOnInsert(true);
FeatureFlags.SetEnableParameterizedDecimal(true);
FeatureFlags.SetEnableTopicAutopartitioningForCDC(true);
}
Expand Down
6 changes: 3 additions & 3 deletions ydb/core/kqp/ut/olap/aggregations_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Y_UNIT_TEST_SUITE(KqpOlapAggregations) {
WriteTestData(kikimr, "/Root/olapStore/olapTable", 20000, 2000000, 7000);
WriteTestData(kikimr, "/Root/olapStore/olapTable", 30000, 1000000, 11000);
}
while (csController->GetInsertFinishedCounter().Val() == 0) {
while (csController->GetCompactionFinishedCounter().Val() == 0) {
Cout << "Wait indexation..." << Endl;
Sleep(TDuration::Seconds(2));
}
Expand Down Expand Up @@ -374,7 +374,7 @@ Y_UNIT_TEST_SUITE(KqpOlapAggregations) {
.AddExpectedPlanOptions("KqpOlapFilter")
#if SSA_RUNTIME_VERSION >= 2U
.AddExpectedPlanOptions("TKqpOlapAgg")
.MutableLimitChecker().SetExpectedResultCount(1)
.MutableLimitChecker().SetExpectedResultCount(2)
#else
.AddExpectedPlanOptions("Condense")
#endif
Expand Down Expand Up @@ -417,7 +417,7 @@ Y_UNIT_TEST_SUITE(KqpOlapAggregations) {
.AddExpectedPlanOptions("KqpOlapFilter")
#if SSA_RUNTIME_VERSION >= 2U
.AddExpectedPlanOptions("TKqpOlapAgg")
.MutableLimitChecker().SetExpectedResultCount(1)
.MutableLimitChecker().SetExpectedResultCount(2)
#else
.AddExpectedPlanOptions("CombineCore")
.AddExpectedPlanOptions("KqpOlapFilter")
Expand Down
24 changes: 2 additions & 22 deletions ydb/core/kqp/ut/olap/indexes_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ Y_UNIT_TEST_SUITE(KqpOlapIndexes) {

Tests::NCommon::TLoggerInit(kikimr).SetComponents({NKikimrServices::TX_COLUMNSHARD}, "CS").SetPriority(NActors::NLog::PRI_DEBUG).Initialize();

std::vector<TString> uids;
std::vector<TString> resourceIds;
std::vector<ui32> levels;

{
WriteTestData(kikimr, "/Root/olapStore/olapTable", 1000000, 300000000, 10000);
WriteTestData(kikimr, "/Root/olapStore/olapTable", 1100000, 300100000, 10000);
Expand All @@ -40,24 +36,8 @@ Y_UNIT_TEST_SUITE(KqpOlapIndexes) {
WriteTestData(kikimr, "/Root/olapStore/olapTable", 1400000, 300400000, 10000);
WriteTestData(kikimr, "/Root/olapStore/olapTable", 2000000, 200000000, 70000);
WriteTestData(kikimr, "/Root/olapStore/olapTable", 3000000, 100000000, 110000);

const auto filler = [&](const ui32 startRes, const ui32 startUid, const ui32 count) {
for (ui32 i = 0; i < count; ++i) {
uids.emplace_back("uid_" + ::ToString(startUid + i));
resourceIds.emplace_back(::ToString(startRes + i));
levels.emplace_back(i % 5);
}
};

filler(1000000, 300000000, 10000);
filler(1100000, 300100000, 10000);
filler(1200000, 300200000, 10000);
filler(1300000, 300300000, 10000);
filler(1400000, 300400000, 10000);
filler(2000000, 200000000, 70000);
filler(3000000, 100000000, 110000);

}
csController->WaitCompactions(TDuration::Seconds(5));

{
auto alterQuery = TStringBuilder() <<
Expand Down Expand Up @@ -102,7 +82,7 @@ Y_UNIT_TEST_SUITE(KqpOlapIndexes) {
Cerr << csController->GetIndexesSkippingOnSelect().Val() << " / " << csController->GetIndexesApprovedOnSelect().Val() << Endl;
CompareYson(result, R"([[0u;]])");
AFL_VERIFY(csController->GetIndexesSkippedNoData().Val() == 0);
AFL_VERIFY(csController->GetIndexesApprovedOnSelect().Val() < csController->GetIndexesSkippingOnSelect().Val() * 0.4)
AFL_VERIFY(csController->GetIndexesApprovedOnSelect().Val() < csController->GetIndexesSkippingOnSelect().Val())
("approve", csController->GetIndexesApprovedOnSelect().Val())("skip", csController->GetIndexesSkippingOnSelect().Val());
}
}
Expand Down
2 changes: 1 addition & 1 deletion ydb/core/kqp/ut/olap/kqp_olap_stats_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ using namespace NYdb::NTable;
Y_UNIT_TEST_SUITE(KqpOlapStats) {
constexpr size_t inserted_rows = 1000;
constexpr size_t tables_in_store = 1000;
constexpr size_t size_single_table = 13152;
constexpr size_t size_single_table = 12688;

const TVector<TTestHelper::TColumnSchema> schema = {
TTestHelper::TColumnSchema().SetName("id").SetType(NScheme::NTypeIds::Int32).SetNullable(false),
Expand Down
22 changes: 11 additions & 11 deletions ydb/core/kqp/ut/olap/kqp_olap_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1504,7 +1504,7 @@ Y_UNIT_TEST_SUITE(KqpOlap) {
auto sender = runtime->AllocateEdgeActor();

InitRoot(server, sender);
Tests::NCommon::TLoggerInit(runtime).Initialize();
// Tests::NCommon::TLoggerInit(runtime).Initialize();

const ui32 numShards = 10;
const ui32 numIterations = 50;
Expand Down Expand Up @@ -2444,10 +2444,10 @@ Y_UNIT_TEST_SUITE(KqpOlap) {
tableInserter.AddRow().Add(2).Add("test_res_2").Add("val2").AddNull();
testHelper.BulkUpsert(testTable, tableInserter);
}
while (csController->GetInsertFinishedCounter().Val() == 0) {
Cout << "Wait indexation..." << Endl;
Sleep(TDuration::Seconds(2));
}
// while (csController->GetCompactionFinishedCounter().Val() == 0) {
// Cout << "Wait indexation..." << Endl;
// Sleep(TDuration::Seconds(2));
// }
testHelper.ReadData("SELECT * FROM `/Root/ColumnTableTest` WHERE id=2", "[[2;\"test_res_2\";#;[\"val1\"]]]");
}

Expand All @@ -2470,19 +2470,19 @@ Y_UNIT_TEST_SUITE(KqpOlap) {
tableInserter.AddRow().Add(1).Add(10);
testHelper.BulkUpsert(testTable, tableInserter);
}
while (csController->GetInsertFinishedCounter().Val() < 1) {
Cout << "Wait indexation..." << Endl;
Sleep(TDuration::Seconds(2));
}
// while (csController->GetCompactionFinishedCounter().Val() < 1) {
// Cout << "Wait compaction..." << Endl;
// Sleep(TDuration::Seconds(2));
// }
testHelper.ReadData("SELECT value FROM `/Root/ColumnTableTest` WHERE id = 1", "[[10]]");
{
TTestHelper::TUpdatesBuilder tableInserter(testTable.GetArrowSchema(schema));
tableInserter.AddRow().Add(1).Add(110);
testHelper.BulkUpsert(testTable, tableInserter);
}
testHelper.ReadData("SELECT value FROM `/Root/ColumnTableTest` WHERE id = 1", "[[110]]");
while (csController->GetInsertFinishedCounter().Val() < 2) {
Cout << "Wait indexation..." << Endl;
while (csController->GetCompactionFinishedCounter().Val() < 1) {
Cout << "Wait compaction..." << Endl;
Sleep(TDuration::Seconds(2));
}
testHelper.ReadData("SELECT value FROM `/Root/ColumnTableTest` WHERE id = 1", "[[110]]");
Expand Down
Loading

0 comments on commit bfb90f6

Please sign in to comment.