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