[
https://issues.apache.org/jira/browse/CALCITE-5288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17606704#comment-17606704
]
Julian Hyde commented on CALCITE-5288:
--------------------------------------
The subject is currently ambiguous. Can you tweak the subject to make it clear
what the desired behavior is? Change 'cannot be' to 'should not be' or 'should
be'.
Also perhaps change the end points in your example from 1, 2, 3, 4 to 5, 10,
15, 20 so that people don't think this is due to discrete domains. (We plan to
one day optimize 'a < 1 or (a > 4 and a < 5)' to 'a < 1' if 'a' is an integer.)
> Expression '(a > 1 and a < 3) or (a > 2 and a < 4)' cannot be simplified to
> 'SEARCH(a, Sarg[(1..4)])'
> -----------------------------------------------------------------------------------------------------
>
> Key: CALCITE-5288
> URL: https://issues.apache.org/jira/browse/CALCITE-5288
> Project: Calcite
> Issue Type: Bug
> Reporter: Aleksey Plekhanov
> Assignee: Aleksey Plekhanov
> Priority: Major
>
> If there is only one range in search/sarg after simplification, the result of
> sarg collector is ignored (\{{SargCollector#needToFix()}} method).
> Expression {{(a > 1 and a < 3) or (a > 2 and a < 4)}} is simplified to
> {{OR(SEARCH(a, Sarg[(1..3)]), SEARCH(a, Sarg[(2..4)]))}} but expected
> {{{}SEARCH(a, Sarg[(1..4)]){}}}.
> If there are more the one intervals or if open interval exists, expressions
> simplified as expected.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)