LukMRVC commented on issue #14448:
URL: https://github.com/apache/datafusion/issues/14448#issuecomment-2685336819

   Hello, so I took a look at it. 
   In the `to_timestamp` case it seems, the UDFScalar  `invoke_with_args` is 
called from a `ConstEvaluator` when an `ExprSimplifier` is trying to rewrite 
the expression. As it's trying simplify within `simplify_with_cycle_count` the 
`ConstEvaluator` returns the original expression wrapped in `Transformed::yes` 
even on `SimplyRuntimeError`, it breaks on when reaching `max_cycles` which is 
3 by default. I guess. This happens 2 times, I guess first when traversing down 
and then back up while trying to optimize the plan, not sure about this. 
Finally, when executed it is invoked one last time.
   
   For the `to_char`, the reason for multiple invocations seems to be the same, 
returning the original expression wrapped with `Transformed::yes` when 
evaluating.
   
   
   
   


-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to