| 540 | } |
| 541 | |
| 542 | std::vector<bool> NullInKey(const std::vector<JoinKeyCmp>& cmp, |
| 543 | const std::vector<std::shared_ptr<Array>>& key) { |
| 544 | ARROW_DCHECK(cmp.size() <= key.size()); |
| 545 | ARROW_DCHECK(key.size() > 0); |
| 546 | std::vector<bool> result; |
| 547 | result.resize(key[0]->length()); |
| 548 | for (size_t i = 0; i < result.size(); ++i) { |
| 549 | result[i] = false; |
| 550 | } |
| 551 | for (size_t i = 0; i < cmp.size(); ++i) { |
| 552 | if (cmp[i] != JoinKeyCmp::EQ) { |
| 553 | continue; |
| 554 | } |
| 555 | if (key[i]->data()->buffers[0] == NULLPTR) { |
| 556 | continue; |
| 557 | } |
| 558 | const uint8_t* nulls = key[i]->data()->buffers[0]->data(); |
| 559 | if (!nulls) { |
| 560 | continue; |
| 561 | } |
| 562 | for (size_t j = 0; j < result.size(); ++j) { |
| 563 | if (!bit_util::GetBit(nulls, j)) { |
| 564 | result[j] = true; |
| 565 | } |
| 566 | } |
| 567 | } |
| 568 | return result; |
| 569 | } |
| 570 | |
| 571 | void GenRandomJoinTables(ExecContext* ctx, Random64Bit& rng, int num_rows_l, |
| 572 | int num_rows_r, int num_keys_common, int num_keys_left, |