pub fn calculate_binary_decimal_math_cast<L, R, O, F>(
left: &dyn Array,
right: &ColumnarValue,
fun: F,
precision: u8,
scale: i8,
cast_target: &DataType,
) -> Result<Arc<PrimitiveArray<O>>>where
L: DecimalType,
R: ArrowPrimitiveType,
O: DecimalType,
F: Fn(L::Native, R::Native) -> Result<O::Native, ArrowError>,
R::Native: TryFrom<ScalarValue>,Expand description
Computes a binary math function for input arrays using a specified function and applies rescaling to given precision and scale.
It casts the right operand to cast_target instead of the default R::DATA_TYPE to preserve
the right operand scale.
§Type Parameters
L: Left array decimal typeR: Right array primitive typeO: Output array decimal typeF: Functor computingfun(l: L, r: R) -> Result<OutputType>
§Arguments
left: Left input arrayright: Right input array or scalar valuefun: Function of typeFprecision: Precision to apply to output decimal arrayscale: Scale to apply to output decimal arraycast_target: Data type to cast right operand to before applying function