brunal commented on code in PR #46408:
URL: https://github.com/apache/arrow/pull/46408#discussion_r2099535326
##########
cpp/src/arrow/ipc/writer.cc:
##########
@@ -327,11 +327,9 @@ class RecordBatchSerializer {
auto offsets = array.value_offsets();
int64_t required_bytes = sizeof(offset_type) * (array.length() + 1);
- if (array.offset() != 0) {
- // If we have a non-zero offset, then the value offsets do not start at
- // zero. We must a) create a new offsets array with shifted offsets and
- // b) slice the values array accordingly
-
+ if (array.offset() != 0 || (array.length() > 0 && array.value_offset(0) >
0)) {
Review Comment:
We definitely can.
This path is extensively tested by TestFeather.SliceStringsRoundTrip.
--
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]