Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cpp/src/arrow/compute/kernels/aggregate_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ enable_if_t<std::is_floating_point<SumType>::value, SumType> SumArray(

// reduce summation of one block (may be smaller than kBlockSize) from leaf node
// continue reducing to upper level if two summations are ready for non-leaf node
auto reduce = [&](SumType block_sum) {
// (capture `levels` by value because of ARROW-17567)
auto reduce = [&, levels](SumType block_sum) {
int cur_level = 0;
uint64_t cur_level_mask = 1ULL;
sum[cur_level] += block_sum;
Expand Down
13 changes: 9 additions & 4 deletions cpp/src/arrow/compute/kernels/scalar_set_lookup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@ struct SetLookupState : public KernelState {
auto visit_valid = [&](T v) {
const auto memo_size = static_cast<int32_t>(memo_index_to_value_index.size());
int32_t unused_memo_index;
auto on_found = [&](int32_t memo_index) { DCHECK_LT(memo_index, memo_size); };
auto on_not_found = [&](int32_t memo_index) {
// (capture `memo_size` by value because of ARROW-17567)
auto on_found = [&, memo_size](int32_t memo_index) {
DCHECK_LT(memo_index, memo_size);
};
auto on_not_found = [&, memo_size](int32_t memo_index) {
DCHECK_EQ(memo_index, memo_size);
memo_index_to_value_index.push_back(index);
};
Expand All @@ -79,8 +82,10 @@ struct SetLookupState : public KernelState {
};
auto visit_null = [&]() {
const auto memo_size = static_cast<int32_t>(memo_index_to_value_index.size());
auto on_found = [&](int32_t memo_index) { DCHECK_LT(memo_index, memo_size); };
auto on_not_found = [&](int32_t memo_index) {
auto on_found = [&, memo_size](int32_t memo_index) {
DCHECK_LT(memo_index, memo_size);
};
auto on_not_found = [&, memo_size](int32_t memo_index) {
DCHECK_EQ(memo_index, memo_size);
memo_index_to_value_index.push_back(index);
};
Expand Down