[
https://issues.apache.org/jira/browse/CALCITE-5036?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17515219#comment-17515219
]
Xurenhe commented on CALCITE-5036:
----------------------------------
Hi all
It's a small change to support predicate's analyzation of IS_NOT_DISTINCT_FROM
In my project, we meet more automatically generated sql from BI's tools. And we
want to simplify the expression before submitting actual executable engine.
PR is ready, welcome to review it.
By the way, I change the some test to keep more rigorous, as CALCITE-5038
described.
> `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: 2h 10m
> 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)