[
https://issues.apache.org/jira/browse/CALCITE-2421?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Vladimir Sitnikov resolved CALCITE-2421.
----------------------------------------
Fix Version/s: 1.19.0
Resolution: Fixed
Fixed in d10aeb7f7e50dc7028ce102a5f590d0c50c49fa8 (released in 1.19.0); the
RexSimplify part landed earlier in 6b3844c0634792263a5073b8ea93565fb3415f41
(CALCITE-2604, 1.18.0).
> 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
> Labels: pull-request-available
> Fix For: 1.19.0
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> 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
(v8.20.10#820010)