Skip to content

Commit bdb2514

Browse files
correction
1 parent 1a5b36d commit bdb2514

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

ydb/core/tx/columnshard/ut_rw/ut_columnshard_read_write.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ using TDefaultTestsController = NKikimr::NYDBTest::NColumnShard::TController;
4040

4141
template <typename TKey = ui64>
4242
bool DataHas(const std::vector<std::shared_ptr<arrow::RecordBatch>>& batches, std::pair<ui64, ui64> range, bool requireUniq = false,
43-
const std::string& columnName = "timestamp") {
43+
const std::string& columnName = "timestamp", const bool inverseCheck = false) {
4444
static constexpr const bool isStrKey = std::is_same_v<TKey, std::string>;
4545

4646
THashMap<TKey, ui32> keys;
@@ -83,7 +83,7 @@ bool DataHas(const std::vector<std::shared_ptr<arrow::RecordBatch>>& batches, st
8383

8484
bool problems = false;
8585
for (auto& [key, count] : keys) {
86-
if (!count) {
86+
if (!count && !inverseCheck) {
8787
Cerr << "No key: " << key << "\n";
8888
problems = true;
8989
}
@@ -108,6 +108,11 @@ bool DataHas(const std::vector<TString>& blobs, const TString& srtSchema, std::p
108108
return DataHas<TKey>(batches, range, requireUniq, columnName);
109109
}
110110

111+
bool DataNotHas(const std::vector<std::shared_ptr<arrow::RecordBatch>>& batches, std::pair<ui64, ui64> range, bool requireUniq = false,
112+
const std::string& columnName = "timestamp") {
113+
return DataHas<ui64>(batches, range, requireUniq, columnName, true);
114+
}
115+
111116
template <typename TKey = ui64>
112117
bool DataHasOnly(const std::vector<std::shared_ptr<arrow::RecordBatch>>& batches, std::pair<ui64, ui64> range) {
113118
static constexpr const bool isStrKey = std::is_same_v<TKey, std::string>;
@@ -788,8 +793,8 @@ void TestWriteRead(bool reboots, const TestTableDescription& table = {}, TString
788793
UNIT_ASSERT(rb->num_rows());
789794
UNIT_ASSERT(CheckOrdered(rb));
790795
UNIT_ASSERT(DataHas({ rb }, portion[0]));
791-
UNIT_ASSERT(!DataHas({ rb }, portion[1]));
792-
UNIT_ASSERT(!DataHas({ rb }, portion[2]));
796+
UNIT_ASSERT(DataNotHas({ rb }, portion[1]));
797+
UNIT_ASSERT(DataNotHas({ rb }, portion[2]));
793798
}
794799

795800
// read 8, planstep 22 (full index)

0 commit comments

Comments
 (0)