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

Method ensureFieldLoaded

bolt/expression/EvalCtx.cpp:316–343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

314}
315
316VectorPtr EvalCtx::ensureFieldLoaded(
317 int32_t index,
318 const SelectivityVector& rows) {
319 auto field = getField(index);
320 if (isLazyNotLoaded(*field)) {
321 const auto& rowsToLoad = isFinalSelection_ ? rows : *finalSelection_;
322
323 LocalDecodedVector holder(*this);
324 auto decoded = holder.get();
325 LocalSelectivityVector baseRowsHolder(*this, 0);
326 auto baseRows = baseRowsHolder.get();
327 auto rawField = field.get();
328 LazyVector::ensureLoadedRows(field, rowsToLoad, *decoded, *baseRows);
329 if (rawField != field.get()) {
330 if (peeledFields_.empty()) {
331 const_cast<RowVector*>(row_)->childAt(index) = field;
332 } else {
333 peeledFields_[index] = field;
334 }
335 }
336 } else {
337 // This is needed in any case because wrappers must be initialized also if
338 // they contain a loaded lazyVector.
339 field->loadedVector();
340 }
341
342 return field;
343}
344
345// Utility function used to extend the size of a complex Vector by wrapping it
346// in a dictionary with identity mapping for existing rows.

Callers 6

getOutputMethod · 0.80
evalSpecialFormMethod · 0.80
evalMethod · 0.80
peelEncodingsMethod · 0.80
evalSpecialFormMethod · 0.80
evalSpecialFormMethod · 0.80

Calls 5

isLazyNotLoadedFunction · 0.85
childAtMethod · 0.80
getMethod · 0.45
emptyMethod · 0.45
loadedVectorMethod · 0.45

Tested by

no test coverage detected