| 943 | namespace internal { |
| 944 | |
| 945 | Result<std::shared_ptr<ArrayData>> GetArrayView( |
| 946 | const std::shared_ptr<ArrayData>& data, const std::shared_ptr<DataType>& out_type) { |
| 947 | ViewDataImpl impl; |
| 948 | impl.root_in_type = data->type; |
| 949 | impl.root_out_type = out_type; |
| 950 | AccumulateLayouts(impl.root_in_type, &impl.in_layouts); |
| 951 | AccumulateArrayData(data, &impl.in_data); |
| 952 | impl.in_data_length = data->length; |
| 953 | |
| 954 | std::shared_ptr<ArrayData> out_data; |
| 955 | // Dummy field for output type |
| 956 | auto out_field = field("", out_type); |
| 957 | RETURN_NOT_OK(impl.MakeDataView(out_field, &out_data)); |
| 958 | RETURN_NOT_OK(impl.CheckInputExhausted()); |
| 959 | return out_data; |
| 960 | } |
| 961 | |
| 962 | } // namespace internal |
| 963 | } // namespace arrow |
no test coverage detected