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

Function gatherCopy

bolt/exec/OperatorUtils.cpp:394–433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

392void gatherCopy(
393 BaseVector* target,
394 vector_size_t targetIndex,
395 vector_size_t count,
396 const std::vector<const RowVector*>& sources,
397 const std::vector<vector_size_t>& sourceIndices,
398 column_index_t sourceChannel) {
399 if (target->isScalar()) {
400 BOLT_DYNAMIC_SCALAR_TYPE_DISPATCH(
401 scalarGatherCopy,
402 target->type()->kind(),
403 target,
404 targetIndex,
405 count,
406 sources,
407 sourceIndices,
408 sourceChannel);
409 } else if (target->type()->isRow()) {
410 std::vector<const RowVector*> rowVectors(count);
411 for (int i = 0; i < count; i++) {
412 rowVectors[i] =
413 sources[i]->children()[sourceChannel]->asUnchecked<RowVector>();
414 target->setNull(
415 targetIndex + i, rowVectors[i]->isNullAt(sourceIndices[i]));
416 }
417 auto result = target->as<RowVector>();
418 for (int i = 0; i < result->childrenSize(); i++) {
419 gatherCopy(
420 result->childAt(i).get(),
421 targetIndex,
422 count,
423 rowVectors,
424 sourceIndices,
425 i);
426 }
427 } else {
428 complexGatherCopy(
429 target, targetIndex, count, sources, sourceIndices, sourceChannel);
430 }
431}
432
433void gatherCopy(
434 RowVector* target,
435 vector_size_t targetIndex,
436 vector_size_t count,

Callers 9

getOutputWithSpillMethod · 0.85
mergeSpillStreamsMethod · 0.85
verifySortedSpillDataMethod · 0.85
verifySortedSpillDataMethod · 0.85
gatherCopyTestMethod · 0.85
TEST_FFunction · 0.85
mainFunction · 0.85

Calls 12

complexGatherCopyFunction · 0.85
childAtMethod · 0.80
isScalarMethod · 0.45
kindMethod · 0.45
typeMethod · 0.45
childrenMethod · 0.45
setNullMethod · 0.45
isNullAtMethod · 0.45
childrenSizeMethod · 0.45
getMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45

Tested by 5

mergeSpillStreamsMethod · 0.68
verifySortedSpillDataMethod · 0.68
verifySortedSpillDataMethod · 0.68
gatherCopyTestMethod · 0.68
TEST_FFunction · 0.68