ch-sc commented on code in PR #14523: URL: https://github.com/apache/datafusion/pull/14523#discussion_r1967699042
########## datafusion/expr/src/udf.rs: ########## @@ -717,9 +722,18 @@ pub trait ScalarUDFImpl: Debug + Send + Sync { /// /// If the function is `ABS(a)`, and the input interval is `a: [-3, 2]`, /// then the output interval would be `[0, 3]`. - fn evaluate_bounds(&self, _input: &[&Interval]) -> Result<Interval> { - // We cannot assume the input datatype is the same of output type. - Interval::make_unbounded(&DataType::Null) + fn evaluate_bounds(&self, input: &[&Interval]) -> Result<Interval> { Review Comment: This should work similar to what we do in PhysicalExpr. By default, this is not supported, but every UDF can implement its own version of bounds evaluation. `evaluate_bounds` in ScalarUDFImpl returns an unbounded Interval which is not helpful for statistics. This is rather a leftover of my attempt to make use of known bounds as much as possible and ignore null bounds. We should probably throw a not implemented error here as well. -- 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