| 392 | void 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 | |
| 433 | void gatherCopy( |
| 434 | RowVector* target, |
| 435 | vector_size_t targetIndex, |
| 436 | vector_size_t count, |