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 2014/11/02 00:25:33 UTC

[jira] [Commented] (CALCITE-448) RelOptUtil::eq() should consider nullability in type check

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

Julian Hyde commented on CALCITE-448:
-------------------------------------

I finally have a repro case for this. It involves a variant of PushFilterIntoJoinRule that will not allow predicates into inner joins, only into left, right and full outer joins. This is similar to what Hive does, and explains why this occurred in Hive but not pure Calcite.

Filters are initially pushed down into the ON clause, then kicked back up. At some point we forget to fix up the RexInputRefs in the condition to match whether that field is nullable.

> 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)