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

Method initialize

bolt/exec/HashProbe.cpp:209–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207}
208
209void HashProbe::initialize() {
210 Operator::initialize();
211 auto jitRowEqVectors =
212 operatorCtx_->driverCtx()->queryConfig().enableJitRowEqVectors();
213 BOLT_CHECK(hashers_.empty());
214 hashers_ = createVectorHashers(probeType_, joinNode_->leftKeys());
215
216 const auto numKeys = hashers_.size();
217 keyChannels_.reserve(numKeys);
218 for (auto& hasher : hashers_) {
219 keyChannels_.push_back(hasher->channel());
220 }
221
222 BOLT_CHECK_NULL(lookup_);
223 lookup_ = std::make_unique<HashLookup>(hashers_, jitRowEqVectors);
224 auto buildType = joinNode_->sources()[1]->outputType();
225 auto tableType =
226 makeTableType(buildType.get(), joinNode_->rightKeys(), joinNode_);
227 if (joinNode_->filter()) {
228 initializeFilter(joinNode_->filter(), probeType_, tableType);
229 }
230
231 size_t numIdentityProjections = 0;
232 for (auto i = 0; i < probeType_->size(); ++i) {
233 auto& name = probeType_->nameOf(i);
234 auto outIndex = outputType_->getChildIdxIfExists(name);
235 if (!outIndex.has_value()) {
236 continue;
237 }
238 projectedInputColumns_.emplace_back(i, *outIndex);
239 if (!isRightJoin(joinType_) && !isFullJoin(joinType_)) {
240 identityProjections_.emplace_back(i, *outIndex);
241 if (*outIndex == i) {
242 ++numIdentityProjections;
243 }
244 }
245 }
246
247 for (column_index_t i = 0; i < outputType_->size(); ++i) {
248 auto tableChannel = tableType->getChildIdxIfExists(outputType_->nameOf(i));
249 if (tableChannel.has_value()) {
250 tableOutputProjections_.emplace_back(tableChannel.value(), i);
251 if (!hitSampling_ &&
252 (outputType_->childAt(i)->kind() == TypeKind::VARCHAR ||
253 outputType_->childAt(i)->kind() == TypeKind::VARBINARY)) {
254 hitSampling_ = true;
255 }
256 }
257 }
258
259 if (numIdentityProjections == probeType_->size() &&
260 tableOutputProjections_.empty()) {
261 isIdentityProjection_ = true;
262 }
263
264 if (nullAware_) {
265 filterTableResult_.resize(1);
266 }

Callers

nothing calls this directly

Calls 15

createVectorHashersFunction · 0.85
makeTableTypeFunction · 0.85
isRightJoinFunction · 0.85
isFullJoinFunction · 0.85
enableJitRowEqVectorsMethod · 0.80
outputTypeMethod · 0.80
getChildIdxIfExistsMethod · 0.80
has_valueMethod · 0.80
childAtMethod · 0.80
driverCtxMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected