emkornfield commented on a change in pull request #11059:
URL: https://github.com/apache/arrow/pull/11059#discussion_r700717071
##########
File path: cpp/src/arrow/array/util.cc
##########
@@ -206,9 +209,9 @@ class ArrayDataEndianSwapper {
auto data = reinterpret_cast<const
MonthDayNanos*>(data_->buffers[1]->data());
ARROW_ASSIGN_OR_RAISE(auto new_buffer,
AllocateBuffer(data_->buffers[1]->size()));
auto new_data =
reinterpret_cast<MonthDayNanos*>(new_buffer->mutable_data());
- int64_t length = data_->length;
+ const int64_t length = data_->buffers[1]->size() / sizeof(MonthDayNanos);
Review comment:
it might be worth adding a comment (here and elsewhere) similar to what
is tested (at this point the data isn't trusted yet so we can't rely on
metadata?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]