| 187 | |
| 188 | template <typename StatisticsType> |
| 189 | Status MakeMinMaxIntegralScalar(const StatisticsType& statistics, |
| 190 | const ::arrow::DataType& arrow_type, |
| 191 | std::shared_ptr<::arrow::Scalar>* min, |
| 192 | std::shared_ptr<::arrow::Scalar>* max) { |
| 193 | const auto column_desc = statistics.descr(); |
| 194 | const auto& logical_type = column_desc->logical_type(); |
| 195 | const auto& integer = checked_pointer_cast<const IntLogicalType>(logical_type); |
| 196 | const bool is_signed = integer->is_signed(); |
| 197 | |
| 198 | switch (integer->bit_width()) { |
| 199 | case 8: |
| 200 | return is_signed ? MakeMinMaxScalar<int8_t>(statistics, min, max) |
| 201 | : MakeMinMaxScalar<uint8_t>(statistics, min, max); |
| 202 | case 16: |
| 203 | return is_signed ? MakeMinMaxScalar<int16_t>(statistics, min, max) |
| 204 | : MakeMinMaxScalar<uint16_t>(statistics, min, max); |
| 205 | case 32: |
| 206 | return is_signed ? MakeMinMaxScalar<int32_t>(statistics, min, max) |
| 207 | : MakeMinMaxScalar<uint32_t>(statistics, min, max); |
| 208 | case 64: |
| 209 | return is_signed ? MakeMinMaxScalar<int64_t>(statistics, min, max) |
| 210 | : MakeMinMaxScalar<uint64_t>(statistics, min, max); |
| 211 | } |
| 212 | |
| 213 | return Status::OK(); |
| 214 | } |
| 215 | |
| 216 | static Status FromInt32Statistics(const Int32Statistics& statistics, |
| 217 | const LogicalType& logical_type, |
no test coverage detected