Convert ArrayData to its physical representation so that typed accessors can be constructed with a physical ArrowType (e.g. Date32 → Int32). For REE arrays, only the values child type is converted; the REE wrapper type stays unchanged.
| 206 | // For REE arrays, only the values child type is converted; the REE wrapper |
| 207 | // type stays unchanged. |
| 208 | std::shared_ptr<ArrayData> ToPhysicalData( |
| 209 | const std::shared_ptr<ArrayData>& data, |
| 210 | const std::shared_ptr<DataType>& physical_type) { |
| 211 | if (data->type->id() == Type::RUN_END_ENCODED) { |
| 212 | const auto& ree_type = checked_cast<const RunEndEncodedType&>(*data->type); |
| 213 | auto result = data->Copy(); |
| 214 | auto values_copy = result->child_data[1]->Copy(); |
| 215 | values_copy->type = physical_type; |
| 216 | result->type = run_end_encoded(ree_type.run_end_type(), physical_type); |
| 217 | result->child_data[1] = std::move(values_copy); |
| 218 | return result; |
| 219 | } |
| 220 | auto result = data->Copy(); |
| 221 | result->type = physical_type; |
| 222 | return result; |
| 223 | } |
| 224 | |
| 225 | /// Read a run-end value from any supported run-end integer representation. |
| 226 | int64_t GetRunEndValue(const ArraySpan& run_ends, int64_t physical_index) { |
no test coverage detected