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

Zoltan Haindrich commented on CALCITE-2687:
-------------------------------------------

this is probably caused by CALCITE-2675 ; I've not yet found a case in which 
that simplify call would not "save" this from the issue.

> Is distinct from could lead to Exceptions in ReduceExpressionRule
> -----------------------------------------------------------------
>
>                 Key: CALCITE-2687
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2687
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Zoltan Haindrich
>            Assignee: Zoltan Haindrich
>            Priority: Major
>
> Test:
> {code}
>   @Test
>   public void testReduceConstants4() throws Exception {
>     HepProgram program = new HepProgramBuilder()
>         .addRuleInstance(ReduceExpressionsRule.PROJECT_INSTANCE)
>         .addRuleInstance(ReduceExpressionsRule.FILTER_INSTANCE)
>         .addRuleInstance(ReduceExpressionsRule.JOIN_INSTANCE)
>         .build();
>     String sql = "select e.mgr is not distinct from f.mgr from emp e join emp 
> f on (e.mgr=f.mgr) where e.mgr is null";
>     sql(sql).with(program)
>         .check();
>   }
> {code}
> Unfortunately the exception doesn't have a stacktrace by default; just some 
> type:
> {code}
> org.apache.calcite.adapter.enumerable.RexToLixTranslator$AlwaysNull
> {code}
> Translation is not possible at this point: 
> https://github.com/apache/calcite/blob/d32ee5c320938b5c34ce09df2276c9570c27a301/core/src/main/java/org/apache/calcite/adapter/enumerable/RexToLixTranslator.java#L746
> the underlying rexNode is:
> {code}
> CAST(null):INTEGER NOT NULL
> {code}
> which is problematic



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to