MCPcopy Create free account
hub / github.com/bytedance/bolt / TEST_F

Function TEST_F

bolt/exec/tests/NestedLoopJoinTest.cpp:165–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163};
164
165TEST_F(NestedLoopJoinTest, emptyBuildOrProbeWithoutFilter) {
166 auto empty = makeRowVector({"u0"}, {makeFlatVector<StringView>({})});
167 auto nonEmpty = makeRowVector({"t0"}, {makeFlatVector<StringView>({"foo"})});
168 auto expected = makeRowVector({makeFlatVector<StringView>({"foo", "foo"})});
169
170 auto testJoin = [&](const std::vector<RowVectorPtr>& leftVectors,
171 const std::vector<RowVectorPtr>& rightVectors,
172 core::JoinType joinType,
173 const std::vector<std::string>& outputLayout,
174 const VectorPtr& expected) {
175 auto planNodeIdGenerator = std::make_shared<core::PlanNodeIdGenerator>();
176 auto plan = PlanBuilder(planNodeIdGenerator)
177 .values(leftVectors)
178 .localPartitionRoundRobinRow()
179 .nestedLoopJoin(
180 PlanBuilder(planNodeIdGenerator)
181 .values(rightVectors)
182 .localPartition({})
183 .planNode(),
184 "",
185 outputLayout,
186 joinType)
187 .planNode();
188 AssertQueryBuilder builder{plan};
189 auto result = builder.copyResults(pool());
190 bytedance::bolt::test::assertEqualVectors(expected, result);
191 };
192
193 testJoin({nonEmpty}, {empty}, core::JoinType::kLeft, {"t0"}, nonEmpty);
194 testJoin(
195 {nonEmpty, nonEmpty},
196 {empty, empty},
197 core::JoinType::kLeft,
198 {"t0"},
199 expected);
200 testJoin({empty}, {nonEmpty}, core::JoinType::kLeft, {"u0"}, empty);
201
202 testJoin({empty}, {nonEmpty}, core::JoinType::kRight, {"t0"}, nonEmpty);
203 testJoin(
204 {empty, empty},
205 {nonEmpty, nonEmpty},
206 core::JoinType::kRight,
207 {"t0"},
208 expected);
209 testJoin({nonEmpty}, {empty}, core::JoinType::kRight, {"u0"}, empty);
210
211 testJoin(
212 {nonEmpty, nonEmpty},
213 {empty, empty},
214 core::JoinType::kFull,
215 {"t0", "u0"},
216 makeRowVector({
217 makeFlatVector<StringView>({"foo", "foo"}),
218 makeNullableFlatVector<StringView>({std::nullopt, std::nullopt}),
219 }));
220 testJoin(
221 {empty, empty},
222 {nonEmpty, nonEmpty},

Callers

nothing calls this directly

Calls 15

PlanBuilderClass · 0.85
assertQueryFunction · 0.85
ROWFunction · 0.85
joinTypeNameFunction · 0.85
waitForTaskCompletionFunction · 0.85
memoryManagerFunction · 0.85
projectMethod · 0.80
rowVectorMethod · 0.80
taskMethod · 0.80
mergeDataVectorsMethod · 0.80
addRootPoolMethod · 0.80

Tested by

no test coverage detected