Skip to content

Commit

Permalink
apacheGH-38090: [C++][Emscripten] acero/asof_join_node: Suppress shor…
Browse files Browse the repository at this point in the history
…ten-64-to-32 warnings

We need explicit cast to use `int64_t` for `size_t` on Emscripten.
  • Loading branch information
kou committed Oct 6, 2023
1 parent 3697bcd commit 0ca007b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cpp/src/arrow/acero/asof_join_node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ class KeyHasher {
return hashes_; // cache hit - return cached hashes
}
Invalidate();
size_t batch_length = batch->num_rows();
auto batch_length = static_cast<size_t>(batch->num_rows());
hashes_.resize(batch_length);
for (int64_t i = 0; i < static_cast<int64_t>(batch_length); i += kMiniBatchLength) {
int64_t length = std::min(static_cast<int64_t>(batch_length - i),
Expand Down Expand Up @@ -744,7 +744,7 @@ class InputState {
// Query the key hasher. This may hit cache, which must be valid for the batch.
// Therefore, the key hasher is invalidated when a new batch is pushed - see
// `InputState::Push`.
return key_hasher_->HashesFor(batch)[row];
return key_hasher_->HashesFor(batch)[static_cast<size_t>(row)];
}
if (key_col_index_.size() == 0) {
return 0;
Expand Down Expand Up @@ -1020,7 +1020,8 @@ class CompositeReferenceTable {
// The destination size is dictated by the size of the LHS batch.
row_index_t new_batch_size = lhs_latest_batch->num_rows();
row_index_t new_capacity = rows_.size() + new_batch_size;
if (rows_.capacity() < new_capacity) rows_.reserve(new_capacity);
if (rows_.capacity() < new_capacity)
rows_.reserve(static_cast<size_t>(new_capacity));
}
rows_.resize(rows_.size() + 1);
auto& row = rows_.back();
Expand Down Expand Up @@ -1204,7 +1205,7 @@ class CompositeReferenceTable {
ARROW_ASSIGN_OR_RAISE(auto a_builder, MakeBuilder(type, memory_pool));
Builder& builder = *checked_cast<Builder*>(a_builder.get());
ARROW_RETURN_NOT_OK(builder.Reserve(rows_.size()));
for (row_index_t i_row = 0; i_row < rows_.size(); ++i_row) {
for (size_t i_row = 0; i_row < rows_.size(); ++i_row) {
const auto& ref = rows_[i_row].refs[i_table];
if (ref.batch) {
Status st =
Expand Down

0 comments on commit 0ca007b

Please sign in to comment.