zanmato1984 commented on code in PR #48073:
URL: https://github.com/apache/arrow/pull/48073#discussion_r4145280891
##########
cpp/src/arrow/acero/unmaterialized_table_internal.h:
##########
@@ -172,7 +172,12 @@ class UnmaterializedCompositeTable {
builder.UnsafeAppendNull();
return Status::OK();
}
- builder.UnsafeAppend(bit_util::GetBit(source->template
GetValues<uint8_t>(1), row));
+
+ int64_t array_offset = (source->offset + row) / 8;
+ int64_t bit_offset = (source->offset + row) % 8;
+
+ builder.UnsafeAppend(arrow::bit_util::GetBit(
+ source->template GetValues<uint8_t>(1, array_offset), bit_offset));
Review Comment:
`ArrayData::GetValues` requires `absolute_offset == 0` for bit-packed
buffers. Since `bit_util::GetBit` accepts the full bit offset, could we pass it
the base buffer and apply the offset there instead? This keeps the accessor
within its documented contract and avoids duplicating the byte/bit split.
```suggestion
const int64_t bit_offset =
source->offset + static_cast<int64_t>(row);
builder.UnsafeAppend(bit_util::GetBit(
source->template GetValues<uint8_t>(1, 0), bit_offset));
```
--
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]