Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-37655: [C++] Allow joins of large tables in Acero #37709

Closed
wants to merge 8 commits into from
Closed
9 changes: 5 additions & 4 deletions cpp/src/arrow/acero/swiss_join.cc
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,8 @@ void RowArray::DebugPrintToFile(const char* filename, bool print_sorted) const {
Status RowArrayMerge::PrepareForMerge(RowArray* target,
const std::vector<RowArray*>& sources,
std::vector<int64_t>* first_target_row_id,
MemoryPool* pool) {
MemoryPool* pool,
bool check_key_size) {
ARROW_DCHECK(!sources.empty());

ARROW_DCHECK(sources[0]->is_initialized_);
Expand Down Expand Up @@ -473,7 +474,7 @@ Status RowArrayMerge::PrepareForMerge(RowArray* target,
(*first_target_row_id)[sources.size()] = num_rows;
}

if (num_bytes > std::numeric_limits<uint32_t>::max()) {
if (check_key_size && num_bytes > std::numeric_limits<uint32_t>::max()) {
return Status::Invalid(
"There are more than 2^32 bytes of key data. Acero cannot "
"process a join of this magnitude");
Expand Down Expand Up @@ -1331,7 +1332,7 @@ Status SwissTableForJoinBuild::PreparePrtnMerge() {
partition_keys[i] = prtn_states_[i].keys.keys();
}
RETURN_NOT_OK(RowArrayMerge::PrepareForMerge(target_->map_.keys(), partition_keys,
&partition_keys_first_row_id_, pool_));
&partition_keys_first_row_id_, pool_, true));
oliviermeslin marked this conversation as resolved.
Show resolved Hide resolved

// 2. SwissTable:
//
Expand All @@ -1354,7 +1355,7 @@ Status SwissTableForJoinBuild::PreparePrtnMerge() {
}
RETURN_NOT_OK(RowArrayMerge::PrepareForMerge(&target_->payloads_, partition_payloads,
&partition_payloads_first_row_id_,
pool_));
pool_, false));
}

// Check if we have duplicate keys
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/acero/swiss_join_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class RowArrayMerge {
//
static Status PrepareForMerge(RowArray* target, const std::vector<RowArray*>& sources,
std::vector<int64_t>* first_target_row_id,
MemoryPool* pool);
MemoryPool* pool, bool check_key_size);
oliviermeslin marked this conversation as resolved.
Show resolved Hide resolved

// Copy rows from source array to target array.
// Both arrays must have the same row metadata.
Expand Down
Loading