11moon11 commented on a change in pull request #1637: [CALCITE-3571]
RelBuilder#shouldMergeProject throws an exception for joins with complex
conditions
URL: https://github.com/apache/calcite/pull/1637#discussion_r354647002
##########
File path:
core/src/test/java/org/apache/calcite/test/SqlToRelConverterTest.java
##########
@@ -92,6 +94,15 @@ protected final void check(
sql(sql).convertsTo(plan);
}
+ // TODO(CALCITE-3571): Passes when RelBuilder#shouldMergeProject returns
false.
+ @Ignore public void testJoinWithMergeProjectShouldParse() {
+ final String sql = "WITH query as (select empno, deptno as deptno11,
deptno as deptno12 from emp)\n"
+ + "select query.deptno11, emp.deptno, query.deptno12\n"
+ + "FROM query\n"
+ + "JOIN emp ON (cast(query.empno as Integer) = cast(emp.empno as
Integer))";
+ sql(sql).ok();
+ }
Review comment:
I totally agree. Still in the process of investigating this.
I also wonder if `Projects` will get merged anyways by `ProjectMergeRule` by
the optimizer?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services