Skip to content

Commit 887c78b

Browse files
committed
Parameterize TestBlockJoinOnUint64 helper
1 parent ec4f0c0 commit 887c78b

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

ydb/library/yql/minikql/comp_nodes/ut/mkql_block_map_join_ut.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ namespace {
8181
});
8282
}
8383

84-
void TestBlockJoinOnUint64(EJoinKind joinKind) {
84+
void DoTestBlockJoinOnUint64(EJoinKind joinKind, size_t blockSize, size_t testSize) {
8585
TSetup<false> setup;
8686
TProgramBuilder& pb = *setup.PgmBuilder;
8787

@@ -131,7 +131,6 @@ namespace {
131131
const auto& holderFactory = graph->GetHolderFactory();
132132
auto& ctx = graph->GetContext();
133133

134-
constexpr size_t testSize = 256;
135134
TVector<ui64> keys(testSize);
136135
TVector<ui64> subkeys;
137136
std::iota(keys.begin(), keys.end(), 1);
@@ -142,7 +141,6 @@ namespace {
142141
std::transform(keys.cbegin(), keys.cend(), std::back_inserter(payloads),
143142
[](const auto& value) { return twoLetterPayloads[value].c_str(); });
144143

145-
const size_t blockSize = 64;
146144
size_t current = 0;
147145
TDefaultListRepresentation leftListValues;
148146
while (current < testSize) {
@@ -188,12 +186,19 @@ namespace {
188186
UNIT_ASSERT(blockLengthDatum.is_scalar());
189187
const auto blockLength = blockLengthDatum.scalar_as<arrow::UInt64Scalar>().value;
190188
const auto dictSize = std::count_if(dictKeys.cbegin(), dictKeys.cend(),
191-
[](ui64 key) { return key < testSize; });
189+
[testSize](ui64 key) { return key < testSize; });
192190
const auto expectedLength = joinKind == EJoinKind::LeftSemi ? dictSize
193191
: joinKind == EJoinKind::LeftOnly ? testSize - dictSize
194192
: -1;
195193
UNIT_ASSERT_VALUES_EQUAL(expectedLength, blockLength);
196194
}
195+
196+
void TestBlockJoinOnUint64(EJoinKind joinKind) {
197+
const size_t testSize = 512;
198+
for (size_t blockSize = 8; blockSize <= testSize; blockSize <<= 2) {
199+
DoTestBlockJoinOnUint64(joinKind, blockSize, testSize);
200+
}
201+
}
197202
} // namespace
198203

199204
Y_UNIT_TEST_SUITE(TMiniKQLBlockMapJoinTest) {

0 commit comments

Comments
 (0)