You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2019/02/11 18:53:00 UTC
[jira] [Commented] (CALCITE-2838) Simplification: Remove redundant
IS TRUE checks
[ https://issues.apache.org/jira/browse/CALCITE-2838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16765268#comment-16765268 ]
Julian Hyde commented on CALCITE-2838:
--------------------------------------
I agree that {{x IS TRUE}} is redundant in unknown-as-false mode. However, if {{x}} is nullable the {{IS TRUE}} still useful - it indicates that three-valued logic is being forced into two-valued logic. So, I'd be inclined to keep it, or, in fact, try to push down the {{IS TRUE}} so that the expression becomes two-valued logic throughout.
> Simplification: Remove redundant IS TRUE checks
> -----------------------------------------------
>
> Key: CALCITE-2838
> URL: https://issues.apache.org/jira/browse/CALCITE-2838
> Project: Calcite
> Issue Type: Improvement
> Reporter: Zoltan Haindrich
> Assignee: Zoltan Haindrich
> Priority: Major
>
> In case simplifcation is already processing in unknownAsFalse mode, {{expr IS TRUE}} is redundant - and may just prevent further optimizations from happening:
> {code}
> @Test public void testRedundantIsTrue() {
> // in case of unknownAsFalse
> // x is TRUE <=> x
> checkSimplify3(isTrue(vBool(1)),
> "IS TRUE(?0.bool1)",
> "?0.bool1",
> "IS TRUE(?0.bool1)");
> }
> {code}
> there are some further possibilities
> {code}
> (unknownAsTrue) x is NOT FALSE <=> x
> (unknownAsTrue) x is FALSE <=> not x
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)