| 490 | } |
| 491 | |
| 492 | Result<std::shared_ptr<RecordBatch>> RecordBatch::ViewOrCopyTo( |
| 493 | const std::shared_ptr<MemoryManager>& to) const { |
| 494 | ArrayVector copied_columns; |
| 495 | copied_columns.reserve(num_columns()); |
| 496 | for (const auto& col : columns()) { |
| 497 | ARROW_ASSIGN_OR_RAISE(auto c, col->ViewOrCopyTo(to)); |
| 498 | copied_columns.push_back(std::move(c)); |
| 499 | } |
| 500 | |
| 501 | return Make(schema_, num_rows(), std::move(copied_columns)); |
| 502 | } |
| 503 | |
| 504 | namespace { |
| 505 | struct EnumeratedStatistics { |