[
https://issues.apache.org/jira/browse/CALCITE-5780?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Runkang He updated CALCITE-5780:
--------------------------------
Description:
The following expressions which contain reverse order comparison are always
true:
{code:sql}
1 > x or 1 <= x or x is null
1 < x or 1 >= x or x is null
1 > x or 0 < x or x is null
{code}
But currently these expressions are not fully simplified to TRUE, the current
simplified results are SEARCH operator.
The root cause is that RexSimplify doesn't identify these cases and makes
targeted simplification.
It would be nice if RexSimplify.simplifyOr handled these cases.
was:
The following expressions which contain reverse order comparison are always
true:
{code:sql}
1 > x or 1 <= x or x is null
1 < x or 1 >= x or x is null
1 > x or 0 < x or x is null
{code}
But currently these expressions are not fully simplified to TRUE, the current
simplified results are SEARCH operator.
The root cause is that RexSimplify doesn't identify these cases and makes
targeted simplification.
It would be nice if RexSimplify.simplifyOr handled these cases.
> Always-true OR expressions contain reverse order comparison should be
> simplified to TRUE
> ----------------------------------------------------------------------------------------
>
> Key: CALCITE-5780
> URL: https://issues.apache.org/jira/browse/CALCITE-5780
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Affects Versions: 1.34.0
> Reporter: Runkang He
> Assignee: Runkang He
> Priority: Major
>
> The following expressions which contain reverse order comparison are always
> true:
> {code:sql}
> 1 > x or 1 <= x or x is null
> 1 < x or 1 >= x or x is null
> 1 > x or 0 < x or x is null
> {code}
> But currently these expressions are not fully simplified to TRUE, the current
> simplified results are SEARCH operator.
> The root cause is that RexSimplify doesn't identify these cases and makes
> targeted simplification.
> It would be nice if RexSimplify.simplifyOr handled these cases.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)