[
https://issues.apache.org/jira/browse/CALCITE-2573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16621615#comment-16621615
]
Vladimir Sitnikov commented on CALCITE-2573:
--------------------------------------------
{quote} Rationale: this allows us to reduce the complexity of expressions to be
used in WHERE, HAVING, ON and FILTER clauses because we know that they treat
the two return values the same{quote}
I'm talking regarding single case: LITERAL NULL being returned for the
expression.
Literal NULL is not simpler than FALSE, however literal FALSE simplifies lots
of rules that treat WHERE, ON, etc conditions.
It is much easier to check "filter condition" for literal FALSE rather than
write {{e.equals(falseLiteral) || utils.isnull(e)}} in each and every rule.
Especially when the rule asks for unknownAsFalse
> RexSimplify: simplify NULL to FALSE in uknownAsFalse mode
> ---------------------------------------------------------
>
> Key: CALCITE-2573
> URL: https://issues.apache.org/jira/browse/CALCITE-2573
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.17.0
> Reporter: Vladimir Sitnikov
> Assignee: Julian Hyde
> Priority: Major
> Labels: newbie
>
> {noformat}2018-09-19 20:42:41,804 [pool-1-thread-1] INFO - Randomized test
> identified a potential defect. Feel free to fix that issue
> java.lang.AssertionError: result mismatch: when applied to {}, null yielded
> NULL, and false yielded false
> at org.apache.calcite.rex.RexSimplify.verify(RexSimplify.java:1208)
> at org.apache.calcite.rex.RexSimplify.simplify(RexSimplify.java:178)
> at
> org.apache.calcite.test.fuzzer.RexProgramFuzzyTest.checkTrueFalse(RexProgramFuzzyTest.java:169)
> at
> org.apache.calcite.test.fuzzer.RexProgramFuzzyTest.checkTrueFalse(RexProgramFuzzyTest.java:160)
> Suppressed: org.apache.calcite.test.fuzzer.RexProgramFuzzyTest$1: seed
> -4383181468718104148{noformat}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)