Skip to content

Commit

Permalink
fix(cpp/compute): apache#38074 Fix to avoid error due to implicit typ…
Browse files Browse the repository at this point in the history
…e conversion in uint32_t * int64_t
  • Loading branch information
llama90 committed Oct 11, 2023
1 parent c46f428 commit e996dd4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cpp/src/arrow/compute/light_array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ KeyColumnArray KeyColumnArray::Slice(int64_t offset, int64_t length) const {
KeyColumnArray sliced;
sliced.metadata_ = metadata_;
sliced.length_ = length;
uint32_t fixed_size = metadata_.fixed_length;

sliced.buffers_[0] =
buffers_[0] ? buffers_[0] + (bit_offset_[0] + offset) / 8 : nullptr;
Expand All @@ -95,9 +96,9 @@ KeyColumnArray KeyColumnArray::Slice(int64_t offset, int64_t length) const {
: nullptr;
sliced.bit_offset_[1] = (bit_offset_[1] + offset) % 8;
} else {
sliced.buffers_[1] = buffers_[1] ? buffers_[1] + offset * metadata_.fixed_length : nullptr;
sliced.buffers_[1] = buffers_[1] ? buffers_[1] + offset * fixed_size : nullptr;
sliced.mutable_buffers_[1] =
mutable_buffers_[1] ? mutable_buffers_[1] + offset * metadata_.fixed_length : nullptr;
mutable_buffers_[1] ? mutable_buffers_[1] + offset * fixed_size : nullptr;
sliced.bit_offset_[1] = 0;
}

Expand Down

0 comments on commit e996dd4

Please sign in to comment.