| 267 | } |
| 268 | |
| 269 | void 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 | |
| 309 | void HashProbe::setupSpillRestorForRangePartition( |
| 310 | const std::optional<SpillPartitionId>& restoredPartitionId) { |
nothing calls this directly
no test coverage detected