| 932 | namespace internal { |
| 933 | |
| 934 | Result<std::shared_ptr<ArrayData>> GetArrayView( |
| 935 | const std::shared_ptr<ArrayData>& data, const std::shared_ptr<DataType>& out_type) { |
| 936 | ViewDataImpl impl; |
| 937 | impl.root_in_type = data->type; |
| 938 | impl.root_out_type = out_type; |
| 939 | AccumulateLayouts(impl.root_in_type, &impl.in_layouts); |
| 940 | AccumulateArrayData(data, &impl.in_data); |
| 941 | impl.in_data_length = data->length; |
| 942 | |
| 943 | std::shared_ptr<ArrayData> out_data; |
| 944 | // Dummy field for output type |
| 945 | auto out_field = field("", out_type); |
| 946 | RETURN_NOT_OK(impl.MakeDataView(out_field, &out_data)); |
| 947 | RETURN_NOT_OK(impl.CheckInputExhausted()); |
| 948 | return out_data; |
| 949 | } |
| 950 | |
| 951 | } // namespace internal |
| 952 | } // namespace arrow |
no test coverage detected