[ https://issues.apache.org/jira/browse/CALCITE-5336?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jasmin Trada updated CALCITE-5336: ---------------------------------- Description: Whenever we have IS NOT DISTINCT FROM operator in a predicate, RexUtil's predicateConstants method 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 { "$0" -> "CAST(2020-12-11):DATE"}. was: Whenever we have IS NOT DISTINCT FROM operator in a predicate RexUtil's predicateConstants method 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 { "$0" -> "CAST(2020-12-11):DATE"}. > Support inferring constants from predicates with IS NOT DISTINCT FROM operator > ------------------------------------------------------------------------------ > > Key: CALCITE-5336 > URL: https://issues.apache.org/jira/browse/CALCITE-5336 > Project: Calcite > Issue Type: Improvement > Components: core > Reporter: Jasmin Trada > Priority: Trivial > Original Estimate: 168h > Remaining Estimate: 168h > > Whenever we have IS NOT DISTINCT FROM operator in a predicate, RexUtil's > predicateConstants method 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 > { "$0" -> "CAST(2020-12-11):DATE"}. -- This message was sent by Atlassian Jira (v8.20.10#820010)