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