You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2021/09/16 23:32:00 UTC

[jira] [Comment Edited] (CALCITE-3378) AssertionError for checking RexNode implify

    [ https://issues.apache.org/jira/browse/CALCITE-3378?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17416360#comment-17416360 ] 

Julian Hyde edited comment on CALCITE-3378 at 9/16/21, 11:31 PM:
-----------------------------------------------------------------

Reviewing PR #2517:
* Spell check your commit message & JIRA subject. "implify" is not a word.
* Remove '.' from commit message.
* Describe more of the scenario in the commit message.

Is PR #1478 still relevant? If not, unlink it.


was (Author: julianhyde):
Reviewing PR #2517:
* Spell check your commit message & JIRA subject.
* Remove '.' from commit message.
* Describe more of the scenario in the commit message.

Is PR #1478 still relevant? If not, unlink it.

> 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
>            Assignee: Wang Yanlin
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h 50m
>  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)