[ 
https://issues.apache.org/jira/browse/FLINK-19811?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Caizhi Weng updated FLINK-19811:
--------------------------------
    Description: 
The new version of Calcite introduces the {{SEARCH}} rex call to express range 
conditions. However {{SEARCH}}s in conjunctions are currently not simplified. 
For example, {{AND(=($2, 2020), SEARCH($2, Sarg[2020, 2021]))}} is not 
simplified while it should be simplified to {{=($2, 2020)}}.

This issue is caused by 
[CALCITE-4365|https://issues.apache.org/jira/browse/CALCITE-4365]. We could 
currently extend the {{RexSimplify}} class to temporarily cover this issue.

  was:
The new version of Calcite introduces the {{SEARCH}} rex call to express range 
conditions. However {{SEARCH}}s in conjunctions are currently not simplified. 
For example, {{AND(=($2, 2020), SEARCH($2, Sarg[2020, 2021]))}} is not 
simplified while it should be simplified to {{=($2, 2020)}}.

We can expand the {{SEARCH}} rex calls in {{FlinkRexUtil#simplify}} to achieve 
this. {{RexSimplify#simplify}} in Calcite will do the rest of the work.


> FlinkRexUtil#simplify should simplify search in conjunctions
> ------------------------------------------------------------
>
>                 Key: FLINK-19811
>                 URL: https://issues.apache.org/jira/browse/FLINK-19811
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table SQL / Planner
>            Reporter: Caizhi Weng
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.12.0
>
>
> The new version of Calcite introduces the {{SEARCH}} rex call to express 
> range conditions. However {{SEARCH}}s in conjunctions are currently not 
> simplified. For example, {{AND(=($2, 2020), SEARCH($2, Sarg[2020, 2021]))}} 
> is not simplified while it should be simplified to {{=($2, 2020)}}.
> This issue is caused by 
> [CALCITE-4365|https://issues.apache.org/jira/browse/CALCITE-4365]. We could 
> currently extend the {{RexSimplify}} class to temporarily cover this issue.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to