danny0405 commented on a change in pull request #1453: [CALCITE-3346] Enable
some ignored tests in RelOptRuleTests
URL: https://github.com/apache/calcite/pull/1453#discussion_r327486568
##########
File path: core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
##########
@@ -3614,105 +3603,175 @@ private void transitiveInference(RelOptRule...
extraRules) throws Exception {
}
@Test public void testTransitiveInferenceJoin() throws Exception {
- transitiveInference();
+ final String sql = "select 1 from sales.emp d"
+ + " inner join sales.emp e on d.deptno = e.deptno where e.deptno > 7";
+ transitiveInference(sql);
}
@Test public void testTransitiveInferenceProject() throws Exception {
- transitiveInference();
+ final String sql = "select 1 from (select * from sales.emp where deptno >
7)"
+ + " d inner join sales.emp e on d.deptno = e.deptno";
+ transitiveInference(sql);
}
@Test public void testTransitiveInferenceAggregate() throws Exception {
- transitiveInference();
+ final String sql = "select 1 from (select deptno, count(*) from sales.emp
where deptno > 7"
+ + " group by deptno) d inner join sales.emp e on d.deptno = e.deptno";
+ transitiveInference(sql);
}
@Test public void testTransitiveInferenceUnion() throws Exception {
- transitiveInference();
+ final String sql = "select 1 from (\n"
+ + "select deptno from sales.emp where deptno > 7\n"
+ + "union all select deptno from sales.emp where deptno > 10) d\n"
+ + "inner join sales.emp e on d.deptno = e.deptno";
+ transitiveInference(sql);
}
@Test public void testTransitiveInferenceJoin3way() throws Exception {
- transitiveInference();
+ final String sql = "select 1 from sales.emp d\n"
+ + "inner join sales.emp e on d.deptno = e.deptno\n"
+ + "inner join sales.emp f on e.deptno = f.deptno\n"
+ + "where d.deptno > 7";
+ transitiveInference(sql);
}
@Test public void testTransitiveInferenceJoin3wayAgg() throws Exception {
- transitiveInference();
+ final String sql = "select 1 from\n"
+ + "(select deptno, count(*) from sales.emp where deptno > 7 group by
deptno) d\n"
+ + "inner join sales.emp e on d.deptno = e.deptno\n"
+ + "inner join sales.emp f on e.deptno = f.deptno";
+ transitiveInference(sql);
}
@Test public void testTransitiveInferenceLeftOuterJoin() throws Exception {
- transitiveInference();
+ final String sql = "select 1 from sales.emp d left outer join"
+ + " sales.emp e on d.deptno = e.deptno where d.deptno > 7 and
e.deptno > 9";
+ transitiveInference(sql);
}
@Test public void testTransitiveInferenceRightOuterJoin() throws Exception {
- transitiveInference();
+ final String sql = "select 1 from sales.emp d"
+ + " right outer join sales.emp e on d.deptno = e.deptno"
+ + " where d.deptno > 7 and e.deptno > 9";
+ transitiveInference(sql);
}
@Test public void testTransitiveInferenceFullOuterJoin() throws Exception {
- transitiveInference();
+ final String sql = "select 1 from sales.emp d full outer join sales.emp e"
+ + " on d.deptno = e.deptno where d.deptno > 7 and e.deptno > 9";
+ transitiveInference(sql);
}
@Test public void testTransitiveInferencePreventProjectPullUp()
throws Exception {
- transitiveInference();
+ final String sql = "select 1 from (select comm as deptno from sales.emp
where deptno > 7) d"
+ + " inner join sales.emp e on d.deptno = e.deptno";
+ transitiveInference(sql);
}
@Test public void testTransitiveInferencePullUpThruAlias() throws Exception {
- transitiveInference();
+ final String sql = "select 1 from (select comm as deptno from sales.emp
where comm > 7) d"
+ + " inner join sales.emp e on d.deptno = e.deptno";
+ transitiveInference(sql);
}
@Test public void testTransitiveInferenceConjunctInPullUp() throws Exception
{
- transitiveInference();
+ final String sql = "select 1 from sales.emp d"
+ + " inner join sales.emp e on d.deptno = e.deptno"
+ + " where d.deptno in (7, 9) or d.deptno > 10";
Review comment:
Add all the new line character in where you break the string in the code.
----------------------------------------------------------------
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