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.
| 560 | // physical accessors, but doing so ends up too cumbersome. |
| 561 | // Instead, we simply create the desired concrete Array objects. |
| 562 | inline std::shared_ptr<Array> GetPhysicalArray( |
| 563 | const Array& array, const std::shared_ptr<DataType>& physical_type) { |
| 564 | auto new_data = array.data()->Copy(); |
| 565 | new_data->type = physical_type; |
| 566 | return MakeArray(std::move(new_data)); |
| 567 | } |
| 568 | |
| 569 | inline ArrayVector GetPhysicalChunks(const ArrayVector& chunks, |
| 570 | const std::shared_ptr<DataType>& physical_type) { |
no test coverage detected