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

Ashutosh Chauhan commented on CALCITE-448:
------------------------------------------

Minimal Hive query which results in this is:
{code}
SELECT a.key from myinput1 a LEFT OUTER JOIN myinput1 b ON ( b.value > 50 ) 
RIGHT OUTER JOIN myinput1 c ON ( b.value > 50 );
{code}

Optiq plan corresponding to this is:
{code}
RelOptUtil.toString(Plan)
  HiveProjectRel(key=[$0])
  HiveJoinRel(condition=[>($6, 50)], joinType=[right])
    HiveJoinRel(condition=[>($6, 50)], joinType=[left])
      HiveTableScanRel(table=[[default.myinput1]])
      HiveTableScanRel(table=[[default.myinput1]])
    HiveTableScanRel(table=[[default.myinput1]])
{code}

> RelOptUtil::eq() should consider nullability in type check
> ----------------------------------------------------------
>
>                 Key: CALCITE-448
>                 URL: https://issues.apache.org/jira/browse/CALCITE-448
>             Project: Calcite
>          Issue Type: Bug
>    Affects Versions: 0.9.2-incubating
>            Reporter: Ashutosh Chauhan
>            Assignee: Julian Hyde
>
> Filter should be allowed to be constructed even when types are {{INTEGER}} && 
> {{INTEGER NOT NULL}} respectively. Currently, it fails with :
> {code}
>  java.lang.AssertionError: type mismatch:
> type1:
> INTEGER NOT NULL
> type2:
> INTEGER
>       at org.eigenbase.relopt.RelOptUtil.eq(RelOptUtil.java:1566)
>       at 
> org.eigenbase.rex.RexProgramBuilder$RegisterInputShuttle.visitInputRef(RexProgramBuilder.java:899)
>       at 
> org.eigenbase.rex.RexProgramBuilder$RegisterInputShuttle.visitInputRef(RexProgramBuilder.java:878)
>       at org.eigenbase.rex.RexInputRef.accept(RexInputRef.java:102)
>       at org.eigenbase.rex.RexShuttle.visitList(RexShuttle.java:129)
>       at org.eigenbase.rex.RexShuttle.visitCall(RexShuttle.java:78)
>       at 
> org.eigenbase.rex.RexProgramBuilder$RegisterShuttle.visitCall(RexProgramBuilder.java:843)
>       at 
> org.eigenbase.rex.RexProgramBuilder$RegisterShuttle.visitCall(RexProgramBuilder.java:841)
>       at org.eigenbase.rex.RexCall.accept(RexCall.java:105)
>       at 
> org.eigenbase.rex.RexProgramBuilder.registerInput(RexProgramBuilder.java:272)
>       at 
> org.eigenbase.rex.RexProgramBuilder.addCondition(RexProgramBuilder.java:247)
>       at 
> org.eigenbase.relopt.RelOptUtil.pushFilterPastProject(RelOptUtil.java:2367)
>       at 
> org.eigenbase.rel.rules.PushFilterPastProjectRule.onMatch(PushFilterPastProjectRule.java:80)
>       at 
> org.eigenbase.relopt.AbstractRelOptPlanner.fireRule(AbstractRelOptPlanner.java:321)
>       at org.eigenbase.relopt.hep.HepPlanner.applyRule(HepPlanner.java:488)
>       at org.eigenbase.relopt.hep.HepPlanner.applyRules(HepPlanner.java:365)
>       at 
> org.eigenbase.relopt.hep.HepPlanner.executeInstruction(HepPlanner.java:258)
>       at 
> org.eigenbase.relopt.hep.HepInstruction$RuleCollection.execute(HepInstruction.java:68)
>       at 
> org.eigenbase.relopt.hep.HepPlanner.executeProgram(HepPlanner.java:179)
>       at org.eigenbase.relopt.hep.HepPlanner.findBestExp(HepPlanner.java:166)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to