[
https://issues.apache.org/jira/browse/CALCITE-4993?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17983767#comment-17983767
]
xiong duan commented on CALCITE-4993:
-------------------------------------
Fixed in
[3a9ee36|https://github.com/apache/calcite/commit/3a9ee36c11a2ade12993a49b6fdf37cb4d0fe1f6].
Thanks for the review [~mbudiu] .
> Simplify EQUALS or NOT-EQUALS with other number comparison
> ----------------------------------------------------------
>
> Key: CALCITE-4993
> URL: https://issues.apache.org/jira/browse/CALCITE-4993
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.29.0
> Reporter: xiong duan
> Assignee: xiong duan
> Priority: Major
>
> For example(SELECT expression FROM table), The Plan is EnumerableCalc
> description:
> 1:
> {code:java}
> "cust_id"<>5 and "cust_id">3 and "cust_id"< 10{code}
> Before:
> {noformat}
> expr#0..1=[{inputs}], expr#2=[CAST($t0):INTEGER NOT NULL], expr#3=[5],
> expr#4=[<>($t2, $t3)], expr#5=[3], expr#6=[>($t0, $t5)], expr#7=[10],
> expr#8=[<($t0, $t7)], expr#9=[AND($t4, $t6, $t8)], EXPR$0=[$t9]{noformat}
> After:
> {noformat}
> (expr#0..1=[{inputs}], expr#2=[Sarg[(3..5), (5..10)]], expr#3=[SEARCH($t0,
> $t2)], EXPR$0=[$t3]){noformat}
> 2:
> {code:java}
> "cust_id"=5 and "cust_id">3 and "cust_id"< 10{code}
> Before:
> {noformat}
> expr#0..1=[{inputs}], expr#2=[CAST($t0):INTEGER NOT NULL], expr#3=[5],
> expr#4=[=($t2, $t3)], expr#5=[3], expr#6=[>($t0, $t5)], expr#7=[10],
> expr#8=[<($t0, $t7)], expr#9=[AND($t4, $t6, $t8)], EXPR$0=[$t9]{noformat}
> After:
> {noformat}
> expr#0..1=[{inputs}], expr#2=[5], expr#3=[=($t0, $t2)], EXPR$0=[$t3]{noformat}
> 3:
> {code:java}
> "cust_id"=5 and "cust_id">6 and "cust_id"< 10{code}
> Before:
> {noformat}
> expr#0..1=[{inputs}], expr#2=[CAST($t0):INTEGER NOT NULL], expr#3=[5],
> expr#4=[=($t2, $t3)], expr#5=[6], expr#6=[>($t0, $t5)], expr#7=[10],
> expr#8=[<($t0, $t7)], expr#9=[AND($t4, $t6, $t8)], EXPR$0=[$t9]{noformat}
> After:
> {noformat}
> expr#0..1=[{inputs}], expr#2=[false], EXPR$0=[$t2]{noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)