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

Support inferring constants from predicates with IS NOT DISTINCT FROM operator

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • None
    • 1.33.0
    • core

    Description

      Whenever we have IS NOT DISTINCT FROM operator in a predicate, the predicateConstants method in RexUtil is not able to identify the constants.

      E.g., If we make a predicate as given below,

      //dec20 = IS_NOT_DISTINCT_FROM($0, CAST(2020-12-11):DATE)
      
      RexNode dec20 = rexB.makeCall(IS_NOT_DISTINCT_FROM,
                  rexB.makeInputRef(dateColumnType, 0),
                  rexB.makeLiteral(new DateString(2020, 12, 11), dateColumnType, false));
      

      and if we call RexUtil.predicateConstants(RexNode.class, rexB, Arrays.asList(dec20)),
      it will return an empty map, but it should have returned something like this:

      { "$0" -> "CAST(2020-12-11):DATE"}
      

      Attachments

        Issue Links

          Activity

            People

              jtrada Jasmin Trada
              jtrada Jasmin Trada
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 168h
                  168h
                  Remaining:
                  Remaining Estimate - 167h 40m
                  167h 40m
                  Logged:
                  Remaining Estimate - 167h 40m
                  20m