| 102 | } |
| 103 | |
| 104 | Result<std::shared_ptr<ArrowType>> MakeArrowTimestamp(const LogicalType& logical_type) { |
| 105 | const auto& timestamp = checked_cast<const TimestampLogicalType&>(logical_type); |
| 106 | const bool utc_normalized = timestamp.is_adjusted_to_utc(); |
| 107 | static const char* utc_timezone = "UTC"; |
| 108 | switch (timestamp.time_unit()) { |
| 109 | case LogicalType::TimeUnit::MILLIS: |
| 110 | return (utc_normalized ? ::arrow::timestamp(::arrow::TimeUnit::MILLI, utc_timezone) |
| 111 | : ::arrow::timestamp(::arrow::TimeUnit::MILLI)); |
| 112 | case LogicalType::TimeUnit::MICROS: |
| 113 | return (utc_normalized ? ::arrow::timestamp(::arrow::TimeUnit::MICRO, utc_timezone) |
| 114 | : ::arrow::timestamp(::arrow::TimeUnit::MICRO)); |
| 115 | case LogicalType::TimeUnit::NANOS: |
| 116 | return (utc_normalized ? ::arrow::timestamp(::arrow::TimeUnit::NANO, utc_timezone) |
| 117 | : ::arrow::timestamp(::arrow::TimeUnit::NANO)); |
| 118 | default: |
| 119 | return Status::TypeError("Unrecognized time unit in timestamp logical_type: ", |
| 120 | logical_type.ToString()); |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | Result<std::shared_ptr<ArrowType>> FromByteArray( |
| 125 | const LogicalType& logical_type, const ArrowReaderProperties& reader_properties, |