[
https://issues.apache.org/jira/browse/CALCITE-2555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16620254#comment-16620254
]
Vladimir Sitnikov commented on CALCITE-2555:
--------------------------------------------
So what's the risk?
Wrong results here just means there's a bug in RexSimplify.
For instance,
https://github.com/apache/calcite/blob/7174a4e42bbf6db2a0cfee4d7de718e7cc0cf49c/core/src/main/java/org/apache/calcite/rex/RexSimplify.java#L490-L492
is an apparent bug in simplifyIs2 for {{unknownAsFalse}} case.
it would basically simplify {{IS NULL(null)}} ==since null is simplified to
false in unknownAsFalse==> {{IS NULL(false)}} ==> {{false}}
So I think {{withUnknownAsFalse(false)}} must be added to the line 490
> RexSimplify: >=(true, null) could be simplified to null
> -------------------------------------------------------
>
> Key: CALCITE-2555
> URL: https://issues.apache.org/jira/browse/CALCITE-2555
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Affects Versions: 1.17.0
> Reporter: Vladimir Sitnikov
> Assignee: Julian Hyde
> Priority: Major
> Labels: newbie
>
> {code:java}
> @Test public void simplifyComparisonWithNull() {
> checkSimplify2(ge(trueLiteral, falseLiteral), "true", "true");
> checkSimplify2(ge(trueLiteral, nullBool), "null", "false");
> checkSimplify2(ge(nullBool, nullBool), "null", "false");
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)