[
https://issues.apache.org/jira/browse/CALCITE-2421?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16549986#comment-16549986
]
Julian Hyde commented on CALCITE-2421:
--------------------------------------
I think you should add a parameter to simplifyList only if you add a new test
that demonstrates how it helps.
I'd like us to push on with a fix for CALCITE-2326; it seems that
[~jcamachorodriguez] wants to do the 2-case version (unknown-as-false,
unknown-as-unknown) but I think we should do the 3-case version
(unknown-as-false, unknown-as-true, unknown-as-unknown). unknown-as-true will
help us correctly simplify NOT. For 3 values we will need an enum, but maybe we
can make some of the key functionality methods/properties of the enum.
> RexSimplify#simplifyAnds foregoes some simplications if unknownAsFalse set to
> true
> ----------------------------------------------------------------------------------
>
> Key: CALCITE-2421
> URL: https://issues.apache.org/jira/browse/CALCITE-2421
> Project: Calcite
> Issue Type: Bug
> Reporter: Laurent Goujon
> Assignee: Laurent Goujon
> Priority: Minor
>
> It looks like {{RexSimplify#simplifyAnds}} foregoes some comparison
> simplifications if {{unknownAsFalse}} is set to true, like {{A = A AND B =
> B}} which might be simplified to {{A IS NOT NULL AND B IS NOT NULL}} or even
> {{true}} if {{A}} and {{B}} are known to be not nullable.
> One consequence of this is that the selectivity value might be off as a {{=}}
> comparison has a selectivity of 15% whereas {{IS NOT NULL}} has a selectivity
> of 90%.
> The simplication is skipped because {{RexSimplify#simplifyList}} simplify all
> terms with {{unknownAsFalse}} set to {{false}}, but in
> {{RexSimplify#simplifyAnd2ForUnknownAsFalse}}, there's no attempt at trying
> again to simplify each term.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)