jinchengchenghh commented on code in PR #11441:
URL:
https://github.com/apache/incubator-gluten/pull/11441#discussion_r2735630652
##########
cpp/velox/memory/GpuBufferColumnarBatch.cc:
##########
@@ -123,11 +128,21 @@ std::shared_ptr<GpuBufferColumnarBatch>
GpuBufferColumnarBatch::compose(
continue;
}
// Combine the null buffer
- // The last byte may still have space to write when nullBitsRemainder !=
0.
- auto* dst = returnBuffers[bufferIdx]->mutable_data();
- if (batch->bufferAt(bufferIdx) == nullptr) {
- arrow::bit_util::SetBitsTo(dst, rowNumber, batch->numRows(), true);
+ if (batch->bufferAt(bufferIdx) == nullptr ||
batch->bufferAt(bufferIdx)->size() == 0) {
+ if (returnBuffers[bufferIdx] != nullptr) {
+ auto* dst = returnBuffers[bufferIdx]->mutable_data();
+ arrow::bit_util::SetBitsTo(dst, rowNumber, batch->numRows(), true);
+ }
} else {
+ // Need to allocate null buffer.
+ if (returnBuffers[bufferIdx] == nullptr) {
+ std::shared_ptr<arrow::Buffer> buffer;
+ GLUTEN_ASSIGN_OR_THROW(buffer,
arrow::AllocateResizableBuffer(bufferSizes[bufferIdx], pool));
Review Comment:
The bufferSizes is computed here,
https://github.com/apache/incubator-gluten/pull/11441/changes#diff-ce18661fb719aacbaf297406b7d1dc8406164158b10644ce68b15cf51d94ea12R102,
so it is bytes
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]