Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-5036

`RelMetadataQuery#getPulledUpPredicates` support to analyze constant key for the operator of IS_NOT_DISTINCT_FROM

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.31.0
    • None

    Description

      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`

      -- sql
      SELECT deptno,
             mgr,
             ename
      FROM emp
      WHERE deptno IS NOT DISTINCT FROM 10

      By the way, `deptno` need be rewritten to the constant project with number of 10, when applying the rule of CoreRules#PROJECT_REDUCE_EXPRESSIONS

      Attachments

        Issue Links

          Activity

            People

              wojustme Xurenhe
              wojustme Xurenhe
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 40m
                  2h 40m