| 255 | } |
| 256 | |
| 257 | Result<std::shared_ptr<ArrowType>> GetArrowType( |
| 258 | Type::type physical_type, const LogicalType& logical_type, int type_length, |
| 259 | const ArrowReaderProperties& reader_properties, |
| 260 | const std::shared_ptr<const ::arrow::KeyValueMetadata>& metadata) { |
| 261 | if (logical_type.is_null()) { |
| 262 | return ::arrow::null(); |
| 263 | } |
| 264 | |
| 265 | if (logical_type.is_invalid()) { |
| 266 | return GetArrowType(physical_type, *NoLogicalType::Make(), type_length, |
| 267 | reader_properties); |
| 268 | } |
| 269 | |
| 270 | switch (physical_type) { |
| 271 | case ParquetType::BOOLEAN: |
| 272 | return ::arrow::boolean(); |
| 273 | case ParquetType::INT32: |
| 274 | return FromInt32(logical_type, reader_properties); |
| 275 | case ParquetType::INT64: |
| 276 | return FromInt64(logical_type, reader_properties); |
| 277 | case ParquetType::INT96: |
| 278 | return ::arrow::timestamp(reader_properties.coerce_int96_timestamp_unit()); |
| 279 | case ParquetType::FLOAT: |
| 280 | return ::arrow::float32(); |
| 281 | case ParquetType::DOUBLE: |
| 282 | return ::arrow::float64(); |
| 283 | case ParquetType::BYTE_ARRAY: |
| 284 | return FromByteArray(logical_type, reader_properties, metadata); |
| 285 | case ParquetType::FIXED_LEN_BYTE_ARRAY: |
| 286 | return FromFLBA(logical_type, type_length, reader_properties); |
| 287 | default: { |
| 288 | // PARQUET-1565: This can occur if the file is corrupt |
| 289 | return Status::IOError("Invalid physical column type: ", |
| 290 | TypeToString(physical_type)); |
| 291 | } |
| 292 | } |
| 293 | } |
| 294 | |
| 295 | Result<std::shared_ptr<ArrowType>> GetArrowType( |
| 296 | const schema::PrimitiveNode& primitive, |
no test coverage detected