[
https://issues.apache.org/jira/browse/CALCITE-4155?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17171465#comment-17171465
]
Liya Fan commented on CALCITE-4155:
-----------------------------------
[~Chunwei Lei] Thanks a lot for your feedback.
I agree with you that if some intermediate numbers are missing, it is
impossible to reduce comparisons.
For the above example, if the expression is
{{a in (1, 2, 4, 5)}},
We can reduce it to
{{(a >= 1 and a <= 2) or (a >= 4 and a <= 5)}}
It reduces the number of comparisons from 5 to 4.
However, if the expression is
{{a in (1, 3, 5)}},
We cannot simplify the expression and reduce comparisons.
We need to consider the possiblity of increasing comparisons when simplifying
the expression.
> Simplify in expression of discreet values
> -----------------------------------------
>
> Key: CALCITE-4155
> URL: https://issues.apache.org/jira/browse/CALCITE-4155
> Project: Calcite
> Issue Type: New Feature
> Components: core
> Reporter: Liya Fan
> Assignee: Liya Fan
> Priority: Major
>
> For example, given expressions like
> {{a in (1, 2, 3, 4, 5)}}
> or
> {{a = 1 or a = 2 or a = 3 or a = 4 or a = 5}},
> we can simplify it to
> {{a >= 1 and a <= 5}}
> Such simplification reduces the number of value comparisons from 5 to 2.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)