[ https://issues.apache.org/jira/browse/CALCITE-3378?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
jin xing updated CALCITE-3378: ------------------------------ Comment: was deleted (was: [~donnyzone] FYI Is this related to CALCITE-3224 ?) > AssertionError for checking RexNode implify > ------------------------------------------- > > Key: CALCITE-3378 > URL: https://issues.apache.org/jira/browse/CALCITE-3378 > Project: Calcite > Issue Type: Bug > Reporter: Wang Yanlin > Priority: Major > Labels: pull-request-available > Time Spent: 10m > Remaining Estimate: 0h > > When checking implify for RexNode with CAST, get AssertionError. > The test case in *RexImplicationCheckerTest* is like this > {code:java} > @Test public void testRexImplifyWithCast() { > final Fixture f = new Fixture(); > final RexNode left = f.rexBuilder.makeCall( > SqlStdOperatorTable.AND, > f.rexBuilder.makeCall( > SqlStdOperatorTable.EQUALS, > f.str, > f.cast( > f.stringDataType, > f.literal(1))), > f.rexBuilder.makeCall( > SqlStdOperatorTable.EQUALS, > f.i, > f.literal(1))); > final RexNode right = f.rexBuilder.makeCall( > SqlStdOperatorTable.EQUALS, > f.i, > f.literal(1)); > f.checkImplies(left, right); > } > {code} > got exception as below > {code:java} > java.lang.AssertionError: cannot convert DECIMAL literal to class > java.lang.String > at org.apache.calcite.rex.RexLiteral.getValueAs(RexLiteral.java:1067) > at > org.apache.calcite.plan.VisitorDataContext.getValue(VisitorDataContext.java:147) > at > org.apache.calcite.plan.VisitorDataContext.of(VisitorDataContext.java:97) > at > org.apache.calcite.plan.RexImplicationChecker.implies2(RexImplicationChecker.java:236) > at > org.apache.calcite.plan.RexImplicationChecker.impliesConjunction(RexImplicationChecker.java:148) > at > org.apache.calcite.plan.RexImplicationChecker.impliesAny(RexImplicationChecker.java:138) > at > org.apache.calcite.plan.RexImplicationChecker.implies(RexImplicationChecker.java:124) > at > org.apache.calcite.test.RexImplicationCheckerTest$Fixture.checkImplies(RexImplicationCheckerTest.java:658) > at > org.apache.calcite.test.RexImplicationCheckerTest.testRexImplifyWithCast(RexImplicationCheckerTest.java:467) > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)