You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "Xurenhe (Jira)" <ji...@apache.org> on 2022/03/09 08:59:00 UTC
[jira] [Created] (CALCITE-5036) `RelMetadataQuery#getPulledUpPredicates` support to analyze constant key for the operator of IS_NOT_DISTINCT_FROM
Xurenhe created CALCITE-5036:
--------------------------------
Summary: `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
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)