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


##########
cpp/src/arrow/tensor.cc:
##########
@@ -367,42 +412,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->byte_width() *
+                                           container.num_columns() * 
container.num_rows(),
+                                       pool));

Review Comment:
   This is valid, will use `MultiplyWithOverflow` as above in the same file.



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