AlenkaF commented on code in PR #41870:
URL: https://github.com/apache/arrow/pull/41870#discussion_r3225953800


##########
cpp/src/arrow/tensor.cc:
##########
@@ -367,42 +394,42 @@ Status RecordBatchToTensor(const RecordBatch& batch, bool 
null_to_nan, bool row_
   }
 
   // Allocate memory
-  ARROW_ASSIGN_OR_RAISE(
-      std::shared_ptr<Buffer> result,
-      AllocateBuffer(result_type->bit_width() * batch.num_columns() * 
batch.num_rows(),
-                     pool));
+  ARROW_ASSIGN_OR_RAISE(std::shared_ptr<Buffer> result,
+                        AllocateBuffer(result_type->bit_width() *
+                                           container.num_columns() * 
container.num_rows(),
+                                       pool));

Review Comment:
   Yes, makes sense! Also from [the PyArrow 
docs](https://arrow.apache.org/docs/python/generated/pyarrow.allocate_buffer.html):
   
   > size : int
   Number of bytes to allocate (plus internal padding)



-- 
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]

Reply via email to