alamb commented on code in PR #21879:
URL: https://github.com/apache/datafusion/pull/21879#discussion_r3156207483
##########
datafusion/physical-expr-common/src/physical_expr.rs:
##########
@@ -181,10 +181,18 @@ pub trait PhysicalExpr: Any + Send + Sync + Display +
Debug + DynEq + DynHash {
/// A `Result` containing the output interval for the expression in
/// case of success, or an error object in case of failure.
///
+ /// Note that the output bounds must form an **envelope** that contains all
+ /// possible outputs of the expression given the input bounds. While
+ /// expressions should output the tightest possible bounds, they do not
need
+ /// to be exact and can be conservative.
+ ///
/// # Example
///
/// If the expression is `a + b`, and the input intervals are `a: [1, 2]`
/// and `b: [3, 4]`, then the output interval would be `[4, 6]`.
+ ///
+ /// If the expression is `sin(a)`, it is correct (though not precise) to
+ /// produce the interval `[-1, 1]` for any input interval for `a`.
Review Comment:
`Nan` perhaps?
https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=87028bd40d413a14a296b77529201963
sqrt(-1.0): NaN
##########
datafusion/physical-expr-common/src/physical_expr.rs:
##########
@@ -181,10 +181,18 @@ pub trait PhysicalExpr: Any + Send + Sync + Display +
Debug + DynEq + DynHash {
/// A `Result` containing the output interval for the expression in
/// case of success, or an error object in case of failure.
///
+ /// Note that the output bounds must form an **envelope** that contains all
+ /// possible outputs of the expression given the input bounds. While
+ /// expressions should output the tightest possible bounds, they do not
need
+ /// to be exact and can be conservative.
+ ///
/// # Example
///
/// If the expression is `a + b`, and the input intervals are `a: [1, 2]`
/// and `b: [3, 4]`, then the output interval would be `[4, 6]`.
+ ///
+ /// If the expression is `sin(a)`, it is correct (though not precise) to
+ /// produce the interval `[-1, 1]` for any input interval for `a`.
Review Comment:
[`Nan`, `Nan`] perhaps 🤔
https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=87028bd40d413a14a296b77529201963
sqrt(-1.0): NaN
--
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]