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

Method initializeFilter

bolt/exec/HashProbe.cpp:269–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267}
268
269void HashProbe::initializeFilter(
270 const core::TypedExprPtr& filter,
271 const RowTypePtr& probeType,
272 const RowTypePtr& tableType) {
273 std::vector<core::TypedExprPtr> filters = {filter};
274 filter_ =
275 std::make_unique<ExprSet>(std::move(filters), operatorCtx_->execCtx());
276
277 column_index_t filterChannel = 0;
278 std::vector<std::string> names;
279 std::vector<TypePtr> types;
280 auto numFields = filter_->expr(0)->distinctFields().size();
281 names.reserve(numFields);
282 types.reserve(numFields);
283 for (auto& field : filter_->expr(0)->distinctFields()) {
284 const auto& name = field->field();
285 auto channel = probeType->getChildIdxIfExists(name);
286 if (channel.has_value()) {
287 auto channelValue = channel.value();
288 filterInputProjections_.emplace_back(channelValue, filterChannel++);
289 names.emplace_back(probeType->nameOf(channelValue));
290 types.emplace_back(probeType->childAt(channelValue));
291 continue;
292 }
293 channel = tableType->getChildIdxIfExists(name);
294 if (channel.has_value()) {
295 auto channelValue = channel.value();
296 filterTableProjections_.emplace_back(channelValue, filterChannel);
297 names.emplace_back(tableType->nameOf(channelValue));
298 types.emplace_back(tableType->childAt(channelValue));
299 ++filterChannel;
300 continue;
301 }
302 BOLT_FAIL(
303 "Join filter field {} not in probe or build input", field->toString());
304 }
305
306 filterInputType_ = ROW(std::move(names), std::move(types));
307}
308
309void HashProbe::setupSpillRestorForRangePartition(
310 const std::optional<SpillPartitionId>& restoredPartitionId) {

Callers

nothing calls this directly

Calls 12

ROWFunction · 0.85
exprMethod · 0.80
getChildIdxIfExistsMethod · 0.80
has_valueMethod · 0.80
childAtMethod · 0.80
execCtxMethod · 0.45
sizeMethod · 0.45
reserveMethod · 0.45
fieldMethod · 0.45
valueMethod · 0.45
nameOfMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected