[
https://issues.apache.org/jira/browse/CALCITE-6599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17885980#comment-17885980
]
Julian Hyde commented on CALCITE-6599:
--------------------------------------
Maybe the summary should be "RelMdPredicates should pull up more predicates
from VALUES when there are several literals".
[~nobigo], Thanks for doing as I asked. I now worry that I may have asked for
the wrong thing. For simple cases such as 'x = 2' or 'z is null' the rule that
consumes the predicate may not recognize the Sarg form. So, for your example
{code}
VALUES (1, 2, 3, null), (1, 2, null, null), (5, 2, 3, null)
{code}
I think the predicates should be
{noformat}
SEARCH($0, Sarg[1, 5])
$1 = 2
SEARCH($2, Sarg[3; NULL AS TRUE])
IS NULL($3)
{noformat}
> RelMdPredicates pull up wrong predicate from VALUES
> ---------------------------------------------------
>
> Key: CALCITE-6599
> URL: https://issues.apache.org/jira/browse/CALCITE-6599
> Project: Calcite
> Issue Type: Bug
> Reporter: xiong duan
> Priority: Major
> Labels: pull-request-available
>
> For example:
> {code:java}
> {VALUES(1,2,3)}{code}
> Predicates should be ($0=1,$1=2,$2=3), but now is $0=1.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)