jayzhan211 commented on PR #25138:
URL: https://github.com/apache/datafusion/pull/25138#issuecomment-5814361598

   `log(b, power(b, x)) → x` still disagrees with execution when `power` 
overflows or underflows, even for a valid literal base:
   
   ```sql
   SELECT log(2.0, power(2.0, a)), ln(power(2.0, a)) / ln(2.0)
   FROM (VALUES (2000.0::double), (-2000.0::double)) t(a);
   -- 2000   Infinity
   -- -2000  -Infinity
   ```
   
   The other two rules (`log(lit, 1)`, `log(lit, lit)`) can't fire after type 
coercion, because `ConstEvaluator` folds them first (`EXPLAIN SELECT log(2.0, 
1.0), log(2.0, 2.0)` already shows `Float64(0)`, `Float64(1)`). I'd drop all 
three rules and `is_valid_log_base`, same as the `power`/`log` rule you 
removed. The simplify body then reduces to the negative-scale decimal check 
plus `Ok(ExprSimplifyResult::Original(args))`.


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