| 84 | } |
| 85 | |
| 86 | inline std::shared_ptr<Scalar> DecimalScalarFromJSON( |
| 87 | const std::shared_ptr<DataType>& type, const std::string& json) { |
| 88 | const auto& ty = checked_cast<const DecimalType&>(*type); |
| 89 | if (ty.scale() >= 0) return ScalarFromJSON(type, json); |
| 90 | auto p = ty.precision() - ty.scale(); |
| 91 | auto adjusted_ty = ty.id() == Type::DECIMAL128 ? decimal128(p, 0) : decimal256(p, 0); |
| 92 | return Cast(ScalarFromJSON(adjusted_ty, json), type).ValueOrDie().scalar(); |
| 93 | } |
| 94 | |
| 95 | // Call the function with the given arguments, as well as slices of |
| 96 | // the arguments and scalars extracted from the arguments. |
no test coverage detected