Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
When checking implify for RexNode with CAST, get AssertionError.
The test case in RexImplicationCheckerTest is like this
@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); }
got exception as below
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)
Attachments
Issue Links
- links to