[
https://issues.apache.org/jira/browse/CALCITE-5288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17610829#comment-17610829
]
Aleksey Plekhanov commented on CALCITE-5288:
--------------------------------------------
[~libenchao] thanks for the review!
> Expression '(a > 5 and a < 15) or (a > 10 and a < 20)' should be simplified
> to 'SEARCH(a, Sarg[(5..20)])'
> ---------------------------------------------------------------------------------------------------------
>
> 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
> Labels: pull-request-available
> Fix For: 1.33.0
>
> Time Spent: 40m
> Remaining Estimate: 0h
>
> If there is only one range in search/sarg after simplification, the result of
> sarg collector is ignored ({{{}SargCollector#needToFix(){}}} method).
> Expression {{(a > 5 and a < 15) or (a > 10 and a < 20)}} is simplified to
> {{OR(SEARCH(a, Sarg[(5..15)]), SEARCH(a, Sarg[(10..20)]))}} but expected
> {{{}SEARCH(a, Sarg[(5..20)]){}}}.
> 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)