[
https://issues.apache.org/jira/browse/CALCITE-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16568370#comment-16568370
]
Vladimir Sitnikov commented on CALCITE-2438:
--------------------------------------------
Well, there's progress with https://github.com/apache/calcite/pull/776
1) Boolean-related tests seem to pass.
2) There are limitations with {{RexCall.isAlwaysTrue}} for calls like {{true >
false}}. Does it make sense to add those? It is a bit hard to tell if a check
belongs to {{isAlwaysTrue}} or if it belongs to {{RexSimplify}}.
3) There are failures related to COALESCE:
{noformat}
when applied to {$0=false}, COALESCE(OR(null, $0), NOT(false)) yielded true,
and OR(null, $0) yielded NULL
when applied to {$13=NULL}, COALESCE(>($13, true), IS FALSE(false)) yielded
true, and >($13, true) yielded NULL
...
{noformat}
4) There were failures like, the following, and I've mitigated those by adding
explicit {{e.isAlwaysNull()}} check to {{simplifyComparison}}
{noformat}Unable to simplify OR(>=(>($3, false), false), null, OR($14,
OR(false, $10, false, $0)), OR(<=($3, null), AND(null, false, null, $1)))
Caused by: java.lang.NullPointerException
at
com.google.common.base.Preconditions.checkNotNull(Preconditions.java:212)
at com.google.common.collect.Cut$AboveValue.<init>(Cut.java:376)
at com.google.common.collect.Cut.aboveValue(Cut.java:371)
at com.google.common.collect.Range.greaterThan(Range.java:262)
at org.apache.calcite.rex.RexSimplify.range(RexSimplify.java:1503)
at org.apache.calcite.rex.RexSimplify.residue(RexSimplify.java:1043)
at
org.apache.calcite.rex.RexSimplify.simplifyUsingPredicates(RexSimplify.java:986)
at
org.apache.calcite.rex.RexSimplify.simplifyComparison(RexSimplify.java:288)
at
org.apache.calcite.rex.RexSimplify.simplifyComparison(RexSimplify.java:218)
at org.apache.calcite.rex.RexSimplify.simplify_(RexSimplify.java:209)
at org.apache.calcite.rex.RexSimplify.simplifyList(RexSimplify.java:310)
at
org.apache.calcite.rex.RexSimplify.simplifyComparison(RexSimplify.java:225)
at
org.apache.calcite.rex.RexSimplify.simplifyComparison(RexSimplify.java:218)
at org.apache.calcite.rex.RexSimplify.simplify_(RexSimplify.java:209)
fail = 3
dup = 0 at
org.apache.calcite.rex.RexSimplify.lambda$simplify$0(RexSimplify.java:175)
at org.apache.calcite.rex.RexSimplify.verify(RexSimplify.java:1104)
at org.apache.calcite.rex.RexSimplify.simplify(RexSimplify.java:175)
at
org.apache.calcite.rex.RexSimplify.simplifyOrTerms(RexSimplify.java:359)
at org.apache.calcite.rex.RexSimplify.simplifyOr(RexSimplify.java:1065)
at org.apache.calcite.rex.RexSimplify.simplify_(RexSimplify.java:183)
at
org.apache.calcite.rex.RexSimplify.lambda$simplify$0(RexSimplify.java:175)
at org.apache.calcite.rex.RexSimplify.verify(RexSimplify.java:1104)
at org.apache.calcite.rex.RexSimplify.simplify(RexSimplify.java:175)
at
org.apache.calcite.test.RexProgramTest.checkTrueFalse(RexProgramTest.java:1752)
at
org.apache.calcite.test.RexProgramTest.performFuzzyTest(RexProgramTest.java:1855)
{noformat}
5) I have not added numerics/varchars to the test
6) I have not added CASE/COALESCE to the test
> RexCall#isAlwaysTrue return incorrect result
> ---------------------------------------------
>
> Key: CALCITE-2438
> URL: https://issues.apache.org/jira/browse/CALCITE-2438
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.17.0
> Reporter: pengzhiwei
> Assignee: Julian Hyde
> Priority: Critical
> Attachments: 屏幕快照 2018-08-02 下午7.26.20.png, 屏幕快照 2018-08-02
> 下午7.34.26.png
>
>
> In the expression as followed:
> {code:java}
> ((sal IS NULL) IS NOT NULL) IS FALSE
> {code}
> The RexCall#isAlwaysTrue return true,however the correct answer is false.
> I find the reason is that there is a wrong logic in the isAlwaysTrue,when
> getKind() is IS_NOT_FALSE、IS_FALSE and IS_NOT_FALSE :
> !屏幕快照 2018-08-02 下午7.34.26.png!
> Can you have a check for me,thanks!
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)