Next operator for the inner join.
158370 {
158371 if (ht.join_type != JoinType::RIGHT_SEMI && ht.join_type != JoinType::RIGHT_ANTI) {
158372 D_ASSERT(result.ColumnCount() == left.ColumnCount() + ht.output_columns.size());
158373 }
158374
158375 idx_t base_count = 0;
158376 idx_t result_count;
158377 while (this->count > 0) {
158378
158379 if (last_match_count == 0) {
158380 result_count = ScanInnerJoin(keys, chain_match_sel_vector);
158381 } else {
158382 chain_match_sel_vector.Initialize(last_sel_vector);
158383 result_count = last_match_count;
158384 last_match_count = 0;
158385 }
158386
158387 if (result_count > 0) {
158388
158389 if (base_count + result_count > STANDARD_VECTOR_SIZE) {
158390 last_sel_vector.Initialize(chain_match_sel_vector);
158391 last_match_count = result_count;
158392 break;
158393 }
158394
158396
158397 auto ptrs = FlatVector::GetData<data_ptr_t>(
pointers);
158398 for (
idx_t i = 0; i < result_count; i++) {
158399 auto idx = chain_match_sel_vector.get_index(i);
158400
158401
158402
158403 Store<bool>(true, ptrs[idx] + ht.tuple_size);
158404 }
158405 }
158406
158407 if (ht.join_type != JoinType::RIGHT_SEMI && ht.join_type != JoinType::RIGHT_ANTI) {
158408
158409 if (!ht.chains_longer_than_one) {
158410
158411
158412 result.Slice(left, chain_match_sel_vector, result_count);
158413
158414
158415 for (
idx_t i = 0; i < ht.output_columns.size(); i++) {
158416 auto &vector = result.data[left.ColumnCount() + i];
158417 const auto output_col_idx = ht.output_columns[i];
158418 D_ASSERT(vector.GetType() == ht.layout_ptr->GetTypes()[output_col_idx]);
158419 GatherResult(vector, chain_match_sel_vector, result_count, output_col_idx);
158420 }
158421
158422 AdvancePointers();
158423 return;
158424 }
158425
158426
158428 base_count += result_count;
158429 }
158430 }
158431 AdvancePointers();
158432 }
158433
158434 if (base_count > 0) {
158435
158436
158437 result.Slice(left, lhs_sel_vector, base_count);
158438
158439
158440 for (
idx_t i = 0; i < ht.output_columns.size(); i++) {
158441 auto &vector = result.data[left.ColumnCount() + i];
158442 const auto output_col_idx = ht.output_columns[i];
158443 D_ASSERT(vector.GetType() == ht.layout_ptr->GetTypes()[output_col_idx]);
158444 GatherResult(vector, base_count, output_col_idx);
158445 }
158446 }
158447}
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
bool PropagatesBuildSide(JoinType type)
Whether the build side is propagated out of the join.
Definition duckdb.cpp:68427
void UpdateCompactionBuffer(idx_t base_count, SelectionVector &result_vector, idx_t result_count)
Update the data chunk compaction buffer.
Definition duckdb.cpp:158358