Skip to content

Commit

Permalink
improve and fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanmorozov333 committed Jul 26, 2024
1 parent c8b77a8 commit 7b3e845
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ydb/core/kqp/ut/olap/helpers/typed_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class TTypedLocalHelper: public Tests::NCS::THelper {
void GetCount(ui64& count);

template <class TFiller>
void FillTable(const TFiller& fillPolicy, const ui32 pkKff = 0, const ui32 numRows = 800000) const {
void FillTable(const TFiller& fillPolicy, const double pkKff = 0, const ui32 numRows = 800000) const {
std::vector<NArrow::NConstruction::IArrayBuilder::TPtr> builders;
builders.emplace_back(NArrow::NConstruction::TSimpleArrayConstructor<NArrow::NConstruction::TIntSeqFiller<arrow::Int64Type>>::BuildNotNullable("pk_int", numRows * pkKff));
builders.emplace_back(std::make_shared<NArrow::NConstruction::TSimpleArrayConstructor<TFiller>>("field", fillPolicy));
Expand Down
11 changes: 7 additions & 4 deletions ydb/core/kqp/ut/olap/sys_view_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "helpers/get_value.h"

#include <library/cpp/testing/unittest/registar.h>
#include <ydb/core/tx/columnshard/engines/scheme/abstract/index_info.h>
#include <ydb/core/tx/columnshard/hooks/testing/controller.h>
#include <ydb/core/tx/columnshard/test_helper/controllers.h>

Expand Down Expand Up @@ -229,7 +230,9 @@ Y_UNIT_TEST_SUITE(KqpOlapSysView) {
helper.CreateTestOlapTable();
NArrow::NConstruction::TStringPoolFiller sPool(3, 52);
helper.FillTable(sPool, 0, 800000);
csController->WaitCompactions(TDuration::Seconds(10));
csController->WaitCompactions(TDuration::Seconds(5));
helper.FillTable(sPool, 0.5, 800000);
csController->WaitCompactions(TDuration::Seconds(5));

helper.GetVolumes(rawBytes1, bytes1, false, {"new_column_ui64"});
AFL_VERIFY(rawBytes1 == 0);
Expand All @@ -241,9 +244,9 @@ Y_UNIT_TEST_SUITE(KqpOlapSysView) {
csController->WaitActualization(TDuration::Seconds(10));
ui64 rawBytes2;
ui64 bytes2;
helper.GetVolumes(rawBytes2, bytes2, false, {"new_column_ui64"});
AFL_VERIFY(rawBytes2 == 6500023)("real", rawBytes2);
AFL_VERIFY(bytes2 == 38880)("b", bytes2);
helper.GetVolumes(rawBytes2, bytes2, false, { "new_column_ui64", NOlap::IIndexInfo::SPEC_COL_DELETE_FLAG });
AFL_VERIFY(rawBytes2 == 0)("real", rawBytes2);
AFL_VERIFY(bytes2 == 0)("b", bytes2);
}
}

Expand Down
2 changes: 1 addition & 1 deletion ydb/core/tx/columnshard/engines/changes/indexation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ TConclusionStatus TInsertColumnEngineChanges::DoConstructBlobs(TConstructionCont

for (auto& inserted : DataToIndex) {
auto blobSchema = context.SchemaVersions.GetSchemaVerified(inserted.GetSchemaVersion());
std::vector<ui32> filteredIds = inserted.GetMeta().GetSchemaSubset().Apply(blobSchema->GetIndexInfo().GetColumnIds(true));
std::vector<ui32> filteredIds = inserted.GetMeta().GetSchemaSubset().Apply(blobSchema->GetIndexInfo().GetColumnIds(false));
usageColumnIds.insert(filteredIds.begin(), filteredIds.end());
if (inserted.GetMeta().GetModificationType() == NEvWrite::EModificationType::Delete) {
usageColumnIds.emplace((ui32)IIndexInfo::ESpecialColumn::DELETE_FLAG);
Expand Down
2 changes: 0 additions & 2 deletions ydb/core/tx/columnshard/engines/portions/read_with_blobs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ std::optional<TWritePortionInfoWithBlobsResult> TReadPortionInfoWithBlobs::SyncP
std::vector<std::shared_ptr<IPortionDataChunk>> newChunks;
if (it != columnChunks.end()) {
newChunks = to->GetIndexInfo().ActualizeColumnData(it->second, from->GetIndexInfo(), i);
} else {
newChunks = to->GetIndexInfo().MakeEmptyChunks(i, pageSizes, to->GetIndexInfo().GetColumnFeaturesVerified(i));
}
AFL_VERIFY(entityChunksNew.emplace(i, std::move(newChunks)).second);
}
Expand Down

0 comments on commit 7b3e845

Please sign in to comment.