zabetak commented on a change in pull request #2430:
URL: https://github.com/apache/calcite/pull/2430#discussion_r648390223
##########
File path: core/src/test/java/org/apache/calcite/test/JdbcAdapterTest.java
##########
@@ -1045,6 +1045,29 @@ private LockWrapper exclusiveCleanDb(Connection c)
throws SQLException {
.planHasSql("SELECT \"EMPNO\", \"ENAME\"\nFROM
\"SCOTT\".\"EMP\"\nWHERE \"EMPNO\" = ?");
}
+ /**
+ * Test case for
+ * <a
href="https://issues.apache.org/jira/browse/CALCITE-4619">[CALCITE-4619]
+ * "Full join" generates an incorrect execution plan under mysql</a>
+ */
+ @Test void testSupportedCertainJoinType() {
+ CalciteAssert.model(JdbcTest.SCOTT_MYSQL_DIALECT_MODEL)
+ .query("select empno, ename, e.deptno, dname\n"
+ + "from scott.emp e full join scott.dept d\n"
+ + "on e.deptno = d.deptno")
+ .explainContains("PLAN=EnumerableCalc(expr#0..4=[{inputs}],
proj#0..2=[{exprs}], " +
+ "DNAME=[$t4])\n" +
+ " EnumerableHashJoin(condition=[=($2, $3)], joinType=[full])\n" +
+ " JdbcToEnumerableConverter\n" +
+ " JdbcProject(EMPNO=[$0], ENAME=[$1], DEPTNO=[$7])\n" +
+ " JdbcTableScan(table=[[SCOTT, EMP]])\n" +
+ " JdbcToEnumerableConverter\n" +
+ " JdbcProject(DEPTNO=[$0], DNAME=[$1])\n" +
+ " JdbcTableScan(table=[[SCOTT, DEPT]])")
+ .enable(CalciteAssert.DB == CalciteAssert.DatabaseInstance.HSQLDB)
+ .runs();
+ }
Review comment:
You are right `RelToSqlConverterTest` is definitely not the right place.
Thinking a bit more, would be sufficient to just change this line:
`.enable(CalciteAssert.DB == CalciteAssert.DatabaseInstance.HSQLDB)`
to
`.enable(CalciteAssert.DB == CalciteAssert.DatabaseInstance.H2 ||
CalciteAssert.DB == CalciteAssert.DatabaseInstance.MYSQL)`
It is a bit inconvenient since at the moment we are not running with H2 and
MySQL in CI but we can verify that it runs locally by using `calcite.test.db`
property.
--
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]