We could try to reproduce the concrete Array classes' facilities (such as cached raw values pointer) in a separate hierarchy of physical accessors, but doing so ends up too cumbersome. Instead, we simply create the desired concrete Array objects.
| 573 | // physical accessors, but doing so ends up too cumbersome. |
| 574 | // Instead, we simply create the desired concrete Array objects. |
| 575 | inline std::shared_ptr<Array> GetPhysicalArray( |
| 576 | const Array& array, const std::shared_ptr<DataType>& physical_type) { |
| 577 | auto new_data = array.data()->Copy(); |
| 578 | new_data->type = physical_type; |
| 579 | return MakeArray(std::move(new_data)); |
| 580 | } |
| 581 | |
| 582 | inline ArrayVector GetPhysicalChunks(const ArrayVector& chunks, |
| 583 | const std::shared_ptr<DataType>& physical_type) { |
no test coverage detected