@@ -49,7 +49,7 @@ use crate::scalar::DecimalValue;
4949use crate :: scalar:: NumericOperator ;
5050use crate :: scalar:: PrimitiveScalar ;
5151use crate :: scalar:: Scalar ;
52- use crate :: scalar_fn:: fns:: binary:: decimal_add_sub_result_dtype ;
52+ use crate :: scalar_fn:: fns:: binary:: numeric_op_result_decimal_dtype ;
5353
5454fn to_vec_of_scalar ( array : & ArrayRef , ctx : & mut ExecutionCtx ) -> Vec < Scalar > {
5555 // Not fast, but obviously correct
@@ -300,13 +300,14 @@ fn test_decimal_binary_numeric_with_scalar(
300300 let original_values = to_vec_of_scalar ( & canonicalized_array, ctx) ;
301301
302302 let scalar = Scalar :: decimal ( value, decimal_dtype, array. dtype ( ) . nullability ( ) ) ;
303- let result_decimal_dtype = decimal_add_sub_result_dtype ( decimal_dtype) ;
304- let result_dtype = DType :: Decimal ( result_decimal_dtype, array. dtype ( ) . nullability ( ) ) ;
305303
306304 // Decimal Mul/Div are not yet implemented.
307305 let operators = vec ! [ NumericOperator :: Add , NumericOperator :: Sub ] ;
308306
309307 for operator in operators {
308+ let result_decimal_dtype = numeric_op_result_decimal_dtype ( decimal_dtype, operator)
309+ . vortex_expect ( "decimal Add/Sub must have a result dtype" ) ;
310+ let result_dtype = DType :: Decimal ( result_decimal_dtype, array. dtype ( ) . nullability ( ) ) ;
310311 let rhs_const = ConstantArray :: new ( scalar. clone ( ) , array. len ( ) ) . into_array ( ) ;
311312
312313 for lhs_is_array in [ true , false ] {
0 commit comments