[ 
https://issues.apache.org/jira/browse/CALCITE-4155?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17172893#comment-17172893
 ] 

Liya Fan commented on CALCITE-4155:
-----------------------------------

[~julianhyde] Thanks a lot for your helpful suggestions.

CALCITE-4159 is an interesting issue. IMO, however, our patch for this issue 
cannot be used to solve it, because: 1) our patch only support limited ranges; 
2) our patch only support discrete values (e.g. integers).

So maybe CALCITE-4159 can be solved in another patch (I would like to help if 
needed :)).

I agree with you that we should do this in the context of ORs. 

The data structures you suggested are reasonable. After considerations, we want 
to provide some new data structure (which is not complex), because existing 
ones lack some operations (e.g. range merge, cost estimation). Please check if 
it looks reasonable to you. Thank you.

> Simplify IN expression of discrete 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)

Reply via email to