zanmato1984 commented on code in PR #45336: URL: https://github.com/apache/arrow/pull/45336#discussion_r1926891507
########## cpp/src/arrow/compute/row/encode_internal.cc: ########## @@ -260,44 +260,40 @@ void EncoderInteger::Decode(uint32_t start_row, uint32_t num_rows, col_prep.metadata().fixed_length == rows.metadata().fixed_length) { DCHECK_EQ(offset_within_row, 0); uint32_t row_size = rows.metadata().fixed_length; - memcpy(col_prep.mutable_data(1), rows.data(1) + start_row * row_size, - num_rows * row_size); + memcpy(col_prep.mutable_data(1), rows.fixed_length_rows(start_row), + static_cast<int64_t>(num_rows) * row_size); } else if (rows.metadata().is_fixed_length) { - uint32_t row_size = rows.metadata().fixed_length; - const uint8_t* row_base = - rows.data(1) + static_cast<RowTableImpl::offset_type>(start_row) * row_size; - row_base += offset_within_row; uint8_t* col_base = col_prep.mutable_data(1); switch (col_prep.metadata().fixed_length) { case 1: for (uint32_t i = 0; i < num_rows; ++i) { - col_base[i] = row_base[i * row_size]; + col_base[i] = *rows.fixed_length_rows(start_row + i); Review Comment: Sorry this was a mistake. Addressed. Thank you for spotting this! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org