[
https://issues.apache.org/jira/browse/CALCITE-448?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14191056#comment-14191056
]
Julian Hyde commented on CALCITE-448:
-------------------------------------
Can you check whether Hive's AST-to-RelNode translator is doing the right thing?
Note that when translating
{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}
The "b.value" in the first ON clause is a different expression than the
"b.value" in the second ON clause. The first might be not-nullable (if value is
a not-nullable column), while the second is nullable (because it came from the
RHS of a left join).
I am still trying to reproduce this in Calcite (and running into other issues,
namely rules generating an infinite network of project on project on
project...), but please check that Hive's translator is doing the right thing.
> 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)