Stamatis Zampetakis created CALCITE-7160:
--------------------------------------------

             Summary: Simplify AND/OR with DISTINCT predicates to SEARCH
                 Key: CALCITE-7160
                 URL: https://issues.apache.org/jira/browse/CALCITE-7160
             Project: Calcite
          Issue Type: Improvement
          Components: core
    Affects Versions: 1.40.0
            Reporter: Stamatis Zampetakis
            Assignee: Stamatis Zampetakis
             Fix For: 1.41.0


Simplify conjunctions (AND) and disjunctions (OR) with {{IS [NOT] DISTINCT 
FROM}} predicates and literals to {{{}SEARCH{}}}.

+Example I+
{noformat}
OR(IS NOT DISTINCT FROM($0, 10), IS NOT DISTINCT FROM($0, 20))
SEARCH($0, Sarg[10, 20; NULL AS FALSE])
{noformat}
+Example II+
{noformat}
AND(IS DISTINCT FROM($0, 10), IS DISTINCT FROM($0, 20))
SEARCH($0, Sarg[(-∞..10), (10..20), (20..+∞); NULL AS TRUE])
{noformat}
These simplifications are not very different to those performed for EQUALS (=) 
and NOT EQUALS (!=) albeit the special null-ability semantics of the DISTINCT 
predicate.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to