Jefffrey commented on code in PR #18968:
URL: https://github.com/apache/datafusion/pull/18968#discussion_r2570226499


##########
datafusion/functions/src/math/power.rs:
##########
@@ -67,8 +67,27 @@ impl Default for PowerFunc {
 
 impl PowerFunc {
     pub fn new() -> Self {
+        let integer = Coercion::new_implicit(
+            TypeSignatureClass::Native(logical_int64()),
+            vec![TypeSignatureClass::Integer],
+            NativeType::Int64,
+        );
+        let decimal = Coercion::new_exact(TypeSignatureClass::Decimal);
+        let float = Coercion::new_implicit(
+            TypeSignatureClass::Native(logical_float64()),
+            vec![TypeSignatureClass::Numeric],
+            NativeType::Float64,
+        );
         Self {
-            signature: Signature::user_defined(Volatility::Immutable),
+            signature: Signature::one_of(
+                vec![
+                    TypeSignature::Coercible(vec![integer.clone(), 
integer.clone()]),
+                    TypeSignature::Coercible(vec![decimal.clone(), 
integer.clone()]),
+                    TypeSignature::Coercible(vec![decimal.clone(), 
float.clone()]),

Review Comment:
   The exponent would get case to float by the coercible signature, as `float` 
there accepts any numeric as input type
   
   ```rust
           let float = Coercion::new_implicit(
               TypeSignatureClass::Native(logical_float64()),
               vec![TypeSignatureClass::Numeric],
               NativeType::Float64,
           );
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to