| 950 | |
| 951 | template <typename DecimalType> |
| 952 | Status ValidateDecimals(const DecimalType& type) { |
| 953 | using CType = typename TypeTraits<DecimalType>::CType; |
| 954 | if (full_validation) { |
| 955 | const int32_t precision = type.precision(); |
| 956 | return VisitArraySpanInline<DecimalType>( |
| 957 | data, |
| 958 | [&](std::string_view bytes) { |
| 959 | DCHECK_EQ(bytes.size(), DecimalType::kByteWidth); |
| 960 | CType value(reinterpret_cast<const uint8_t*>(bytes.data())); |
| 961 | if (!value.FitsInPrecision(precision)) { |
| 962 | return Status::Invalid("Decimal value ", value.ToIntegerString(), |
| 963 | " does not fit in precision of ", type); |
| 964 | } |
| 965 | return Status::OK(); |
| 966 | }, |
| 967 | []() { return Status::OK(); }); |
| 968 | } |
| 969 | return Status::OK(); |
| 970 | } |
| 971 | |
| 972 | Status CheckBounds(const DataType& type, int64_t min_value, int64_t max_value) { |
| 973 | BoundsChecker checker{data, min_value, max_value}; |
nothing calls this directly
no test coverage detected