amaliujia commented on a change in pull request #2116:
URL: https://github.com/apache/calcite/pull/2116#discussion_r495675536
##########
File path:
core/src/test/java/org/apache/calcite/test/enumerable/EnumerableBatchNestedLoopJoinTest.java
##########
@@ -224,4 +228,104 @@
.with(CalciteConnectionProperty.FORCE_DECORRELATE, forceDecorrelate)
.withSchema("s", new ReflectiveSchema(schema));
}
+
+
+ @Test void jdbcLeftBatchJoinTestSQL1() {
+ final String[] sqls = {null};
+ CalciteAssert.model(JdbcTest.FOODMART_SCOTT_MODEL)
+ .with(Lex.MYSQL)
+ .query(
+ "select e.empno, e.ename, f.store_name, f.store_id from\n"
+ + "(select store_name, store_id from foodmart.store where
store_id < 2) f\n"
+ + " left join SCOTT.emp e on f.store_id < e.empno and e.empno
<= 7369")
+ .withHook(Hook.PLANNER, (Consumer<RelOptPlanner>) planner -> {
+ planner.removeRule(EnumerableRules.ENUMERABLE_CORRELATE_RULE);
+
planner.addRule(EnumerableRules.ENUMERABLE_BATCH_NESTED_LOOP_JOIN_RULE);
+ })
+ .withHook(Hook.QUERY_PLAN, (Consumer<String>) sql -> {
+ sqls[0] = sql;
+ })
+ .returnsUnordered(
+ "empno=7369; ename=SMITH; store_name=HQ; store_id=0",
+ "empno=7369; ename=SMITH; store_name=Store 1; store_id=1");
+
+ assertThat(sqls[0],
+ isLinux("SELECT *\n"
+ + "FROM (SELECT \"EMPNO\", \"ENAME\"\n"
+ + "FROM \"SCOTT\".\"EMP\") AS \"t\"\n"
+ + "WHERE \"EMPNO\" <= 7369 AND (? < \"EMPNO\" OR (? < \"EMPNO\" OR
? < \"EMPNO\") OR (?"
Review comment:
Why this query becomes very complicated? Where is the JOIN?
##########
File path:
core/src/test/java/org/apache/calcite/test/enumerable/EnumerableBatchNestedLoopJoinTest.java
##########
@@ -224,4 +228,104 @@
.with(CalciteConnectionProperty.FORCE_DECORRELATE, forceDecorrelate)
.withSchema("s", new ReflectiveSchema(schema));
}
+
+
+ @Test void jdbcLeftBatchJoinTestSQL1() {
Review comment:
Seems to me that if PR not only supports `EnumerableBatchNestedLoopJoin`
in `JdbcToEnumerableConverter` but also tries to support dynamic parameters?
----------------------------------------------------------------
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]