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

   ### Is your feature request related to a problem or challenge?
   
   The 
[`AnalysisContext`](https://github.com/apache/datafusion/blob/2aff98e002ce6d48008b8bbe2b38ee644a6d5c20/datafusion/physical-expr/src/analysis.rs#L38)
 which is the result of the 
[`analyze`](https://github.com/apache/datafusion/blob/2aff98e002ce6d48008b8bbe2b38ee644a6d5c20/datafusion/physical-expr/src/analysis.rs#L159)
 method for refining column boundaries from a physical expression represents an 
empty set the same as an unbounded set.
   
   For example, in the case where the bounds can not be shrunk, e.g., `a < 0 OR 
a >= 0`, this results an interval of [`None`, `None`], but means [-∞, ∞], i.e., 
[`CERTAINLY_TRUE`](https://github.com/apache/datafusion/blob/2aff98e002ce6d48008b8bbe2b38ee644a6d5c20/datafusion/expr-common/src/interval_arithmetic.rs#L419-L422).
 In the case where the bounds represent an empty set, e.g., `a < 0 AND a > 0`, 
this also results in an interval of [`None`, `None`], but should mean 
[`CERTAINLY_FALSE`](https://github.com/apache/datafusion/blob/2aff98e002ce6d48008b8bbe2b38ee644a6d5c20/datafusion/expr-common/src/interval_arithmetic.rs#L409).
   
   ### Describe the solution you'd like
   
   The `AnalysisContext` should be able to refine such boundaries to the 
correct interval representation _and_ provide an API that can distinguish the 
`CERTAINLY_TRUE` result from `CERTAINLY_FALSE`.
   
   ### Describe alternatives you've considered
   
   I am not sure of any alternatives at the moment.
   
   ### Additional context
   
   This originally came about in 
https://github.com/apache/datafusion/pull/14189, where a test case was added 
for analyzing the expression `(a > 10 AND a < 20) AND (a > 20 AND a < 30)`, 
which resulted in an interval of [`None`, `None`].
   
   See this 
[comment](https://github.com/apache/datafusion/pull/14189#discussion_r1922727191)
 from that PR.


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