MCPcopy Create free account
hub / github.com/apache/datafusion / validate_decimal_precision

Function validate_decimal_precision

datafusion/functions/src/math/round.rs:83–94  ·  view source on GitHub ↗
(
    value: T::Native,
    precision: u8,
    scale: i8,
)

Source from the content-addressed store, hash-verified

81}
82
83fn validate_decimal_precision<T: DecimalType>(
84 value: T::Native,
85 precision: u8,
86 scale: i8,
87) -> Result<T::Native, ArrowError> {
88 T::validate_decimal_precision(value, precision, scale).map_err(|e| {
89 ArrowError::ComputeError(format!(
90 "Decimal overflow: rounded value exceeds precision {precision}: {e}"
91 ))
92 })?;
93 Ok(value)
94}
95
96fn calculate_new_precision_scale<T: DecimalType>(
97 precision: u8,

Callers 2

apply_decimal_opFunction · 0.85
avgMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…