@@ -370,8 +370,6 @@ fn pow_decimal256_float_fallback(
370370
371371/// Compute `power(decimal_base, float_exponent)` by casting the base to
372372/// `Float64` and running `pow` in float space; returns `Float64`.
373- /// `calculate_binary_math` casts the exponent internally and preserves
374- /// scalar shape, so we only need to materialize the base here.
375373fn pow_decimal_via_float64 (
376374 base : & ColumnarValue ,
377375 exponent : & ColumnarValue ,
@@ -399,11 +397,9 @@ impl ScalarUDFImpl for PowerFunc {
399397
400398 fn return_type ( & self , arg_types : & [ DataType ] ) -> Result < DataType > {
401399 // Return type as a function of (base, exponent). After signature
402- // coercion the operands are one of three shapes, plus a NULL on
403- // either side when an operand is a literal NULL:
400+ // coercion, we have to handle the following cases:
404401 //
405- // - NULL on either side -> Float64 (matches the other math
406- // UDFs, which all return Float64 for NULL input)
402+ // - NULL on either side -> Float64 (typed NULL)
407403 // - (Decimal, Float64) -> Float64
408404 // - (Decimal, Int64) -> the base's Decimal type
409405 // - (Float64, Float64) -> Float64
@@ -424,8 +420,8 @@ impl ScalarUDFImpl for PowerFunc {
424420 fn invoke_with_args ( & self , args : ScalarFunctionArgs ) -> Result < ColumnarValue > {
425421 let [ base, exponent] = take_function_args ( self . name ( ) , & args. args ) ?;
426422
427- // No native kernel exists for `(Decimal, Float64)`; bridge via
428- // Float64. The match below handles the remaining coerced shapes .
423+ // No native kernel exists for `(Decimal, Float64)`; bridge by casting
424+ // the base to Float64 .
429425 if base. data_type ( ) . is_decimal ( ) && exponent. data_type ( ) . is_floating ( ) {
430426 return pow_decimal_via_float64 ( base, exponent, args. number_rows ) ;
431427 }
0 commit comments