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

Method getSelectivityVector

bolt/core/QueryCtx.h:283–292  ·  view source on GitHub ↗

Returns an uninitialized SelectivityVector from a pool. Allocates new one if none is available. Make sure to call 'releaseSelectivityVector' when done using the vector to allow for reuse. Prefer using LocalSelectivityVector which takes care of returning the vector to the pool on destruction.

Source from the content-addressed store, hash-verified

281 /// Prefer using LocalSelectivityVector which takes care of returning the
282 /// vector to the pool on destruction.
283 std::unique_ptr<SelectivityVector> getSelectivityVector(int32_t size) {
284 BOLT_CHECK(exprEvalCacheEnabled_ || selectivityVectorPool_.empty());
285 if (selectivityVectorPool_.empty()) {
286 return std::make_unique<SelectivityVector>(size);
287 }
288 auto vector = std::move(selectivityVectorPool_.back());
289 selectivityVectorPool_.pop_back();
290 vector->resizeFill(size);
291 return vector;
292 }
293
294 // Returns an arbitrary SelectivityVector with undefined
295 // content. The caller is responsible for setting the size and

Callers 7

TEST_FFunction · 0.80
evaluateSharedSubexprMethod · 0.80
evalWithMemoMethod · 0.80
LocalSingleRowMethod · 0.80
allocateMethod · 0.80
getMethod · 0.80

Calls 4

backMethod · 0.80
pop_backMethod · 0.80
resizeFillMethod · 0.80
emptyMethod · 0.45

Tested by 1

TEST_FFunction · 0.64