MCPcopy Create free account
hub / github.com/apache/arrow / ProbeBatch_OutputAll

Method ProbeBatch_OutputAll

cpp/src/arrow/acero/hash_join.cc:419–460  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

417 }
418
419 Status ProbeBatch_OutputAll(size_t thread_index, const RowEncoder& exec_batch_keys,
420 const RowEncoder& exec_batch_payloads,
421 const std::vector<int32_t>& match,
422 const std::vector<int32_t>& no_match,
423 std::vector<int32_t>& match_left,
424 std::vector<int32_t>& match_right) {
425 if (join_type_ == JoinType::RIGHT_SEMI || join_type_ == JoinType::RIGHT_ANTI) {
426 // Nothing to output
427 return Status::OK();
428 }
429
430 if (join_type_ == JoinType::LEFT_ANTI || join_type_ == JoinType::LEFT_SEMI) {
431 const std::vector<int32_t>& out_ids =
432 (join_type_ == JoinType::LEFT_SEMI) ? match : no_match;
433
434 for (size_t start = 0; start < out_ids.size(); start += output_batch_size_) {
435 int64_t batch_size_next = std::min(static_cast<int64_t>(out_ids.size() - start),
436 static_cast<int64_t>(output_batch_size_));
437 RETURN_NOT_OK(ProbeBatch_OutputOne(thread_index, batch_size_next,
438 out_ids.data() + start, nullptr));
439 }
440 } else {
441 if (join_type_ == JoinType::LEFT_OUTER || join_type_ == JoinType::FULL_OUTER) {
442 for (size_t i = 0; i < no_match.size(); ++i) {
443 match_left.push_back(no_match[i]);
444 match_right.push_back(RowEncoder::kRowIdForNulls());
445 }
446 }
447
448 ARROW_DCHECK(match_left.size() == match_right.size());
449
450 for (size_t start = 0; start < match_left.size(); start += output_batch_size_) {
451 int64_t batch_size_next =
452 std::min(static_cast<int64_t>(match_left.size() - start),
453 static_cast<int64_t>(output_batch_size_));
454 RETURN_NOT_OK(ProbeBatch_OutputOne(thread_index, batch_size_next,
455 match_left.data() + start,
456 match_right.data() + start));
457 }
458 }
459 return Status::OK();
460 }
461
462 void NullInfoFromBatch(const ExecBatch& batch,
463 std::vector<const uint8_t*>* nn_bit_vectors,

Callers

nothing calls this directly

Calls 4

push_backMethod · 0.80
OKFunction · 0.50
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected