neilconway opened a new issue, #22472:
URL: https://github.com/apache/datafusion/issues/22472

   ### Describe the bug
   
   At present, `power(decimal, float)` returns a decimal , which leads to 
problematic behavior:
   
   ```
   > SELECT power(cast(2.5 as decimal(2,1)), 4.0);
   +--------------------------------+
   | power(Float64(2.5),Float64(4)) |
   +--------------------------------+
   | 3.9                            |
   +--------------------------------+
   1 row(s) fetched.
   Elapsed 0.004 seconds.
   > SELECT power(cast(2.5 as decimal), 4.0);
   Arrow error: Arithmetic overflow: Cannot raise base 25000000000 to exp 4
   ```
   
   ### To Reproduce
   
   _No response_
   
   ### Expected behavior
   
   Both queries should return `39.0625`, and probably of type `Float64`.
   
   ### Additional context
   
   _No response_


-- 
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