You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Xurenhe (Jira)" <ji...@apache.org> on 2022/04/02 06:01:00 UTC

[jira] [Commented] (CALCITE-5036) `RelMetadataQuery#getPulledUpPredicates` support to analyze constant key for the operator of IS_NOT_DISTINCT_FROM

    [ https://issues.apache.org/jira/browse/CALCITE-5036?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17516229#comment-17516229 ] 

Xurenhe commented on CALCITE-5036:
----------------------------------

Hi [~yuanhsh] [~nobigo] 
I see you gave the pass tickets for this pr a few days ago.

There are not any divergence, could you help me merge this pr?

Thanks a lot.
----
PR: https://github.com/apache/calcite/pull/2743

> `RelMetadataQuery#getPulledUpPredicates` support to analyze constant key for the operator of IS_NOT_DISTINCT_FROM
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-5036
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5036
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: Xurenhe
>            Assignee: Xurenhe
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> As we know, `IS NOT DISTINCT FROM` is NULL-Safe equal operator.
> The expression of "{*}`a` IS NOT DISTINCT FROM 10{*}" is equal to "{*}(`a` = 10) IS TRUE{*}".
> Currently, `RelMetadataQuery#getPulledUpPredicates` could analyze the constant from the constant's equal condition in the filter, not support `IS NOT DISTINCT FROM`
> {code:java}
> -- sql
> SELECT deptno,
>        mgr,
>        ename
> FROM emp
> WHERE deptno IS NOT DISTINCT FROM 10{code}
> By the way, `deptno` need be rewritten to the constant project with number of 10, when applying the rule of {*}CoreRules#PROJECT_REDUCE_EXPRESSION{*}S



--
This message was sent by Atlassian Jira
(v8.20.1#820001)