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

Method getValues

bolt/dwio/common/SelectiveStructColumnReader.cpp:347–611  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

345
346} // namespace
347
348void SelectiveStructColumnReaderBase::getValues(
349 const RowSet& rows,
350 VectorPtr* result) {
351 BOLT_CHECK_NOT_NULL(
352 *result, "SelectiveStructColumnReaderBase expects a non-null result");
353
354 auto& rowType = fileType_->isDCMap() ? fileType_->type()->asRow()
355 : result->get()->type()->asRow();
356 if UNLIKELY (fileType_->isDCMap()) {
357 // In case of DCMap, a new RowVevctor is needed
358 // to read out all the underlying data
359 std::vector<VectorPtr> children(rowType.size());
360 fillRowVectorChildren(*result->get()->pool(), rowType, children);
361 *result = std::make_shared<RowVector>(
362 result->get()->pool(),
363 fileType_->type(),
364 nullptr,
365 0,
366 std::move(children));
367 } else {
368 BOLT_CHECK(
369 result->get()->type()->isRow(),
370 "Struct reader expects a result of type ROW.");
371
372 if (auto reused = tryReuseResult(*result)) {
373 *result = std::move(reused);
374 } else {
375 VLOG(1) << "Reallocating result row vector with " << rowType.size()
376 << " children";
377 std::vector<VectorPtr> children(rowType.size());
378 fillRowVectorChildren(*result->get()->pool(), rowType, children);
379 *result = std::make_shared<RowVector>(
380 result->get()->pool(),
381 result->get()->type(),
382 nullptr,
383 0,
384 std::move(children));
385 }
386 }
387
388 auto* resultRow = static_cast<RowVector*>(result->get());
389 resultRow->unsafeResize(rows.size());
390 if (!rows.size()) {
391 resetWhenFilterAll();
392 return;
393 }
394 if (nullsInReadRange_) {
395 auto readerNulls = nullsInReadRange_->as<uint64_t>();
396 auto* nulls = resultRow->mutableNulls(rows.size())->asMutable<uint64_t>();
397 for (size_t i = 0; i < rows.size(); ++i) {
398 bits::setBit(nulls, i, bits::isBitSet(readerNulls, rows[i]));
399 }
400 } else {
401 resultRow->clearNulls(0, rows.size());
402 }
403 bool lazyPrepared = false;
404 for (auto& childSpec : scanSpec_->children()) {

Callers 1

loadInternalMethod · 0.45

Calls 15

fillRowVectorChildrenFunction · 0.85
tryReuseResultFunction · 0.85
isBitSetFunction · 0.85
setConstantFieldFunction · 0.85
setNullFieldFunction · 0.85
MAPFunction · 0.85
mutableNullsMethod · 0.80
projectOutMethod · 0.80
childAtMethod · 0.80
isRowIndexMethod · 0.80
getRowIndexBaseMethod · 0.80
constantValueMethod · 0.80

Tested by

no test coverage detected