| 478 | } // namespace |
| 479 | |
| 480 | Result<std::shared_ptr<RecordBatch>> RecordBatch::CopyTo( |
| 481 | const std::shared_ptr<MemoryManager>& to) const { |
| 482 | ArrayVector copied_columns; |
| 483 | copied_columns.reserve(num_columns()); |
| 484 | for (const auto& col : columns()) { |
| 485 | ARROW_ASSIGN_OR_RAISE(auto c, col->CopyTo(to)); |
| 486 | copied_columns.push_back(std::move(c)); |
| 487 | } |
| 488 | |
| 489 | return Make(schema_, num_rows(), std::move(copied_columns)); |
| 490 | } |
| 491 | |
| 492 | Result<std::shared_ptr<RecordBatch>> RecordBatch::ViewOrCopyTo( |
| 493 | const std::shared_ptr<MemoryManager>& to) const { |