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

Julian Hyde commented on CALCITE-1794:
--------------------------------------

The way I see it, the only problem here is the CAST. It prevents SARGs from 
doing their job. 

You’re suggesting that SARGs can be disabled and alternative simplifications 
added to RexSimplify so that it will work when SARGs are disabled. That is 
madness. It will collapse under the weight of all those special cases.

The PR seems fine. It just needs to be framed as what it is - a minor bug in 
SARG in relation to CAST. 

The biggest problem here is that we didn’t reframe the issue - including 
changing the jira subject - as our understanding of the problem changed. It’s 
hard to review PRs if they are badly framed. 

> Simplify AND numeric comparisons when overlapping
> -------------------------------------------------
>
>                 Key: CALCITE-1794
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1794
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.29.0
>            Reporter: Remus Rusanu
>            Assignee: xiong duan
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Expressions such as {{$1<>1 and $1=2}} can be simplified to {{$1=2}}. Similar 
> {{$1>10 AND $1>20}} can be simplified to {{$1>20}}. Such expressions are 
> produced by the proposed solution for CALCITE-1790 (simplify boolean CASE to 
> complex AND/OR).



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to