iwanttobepowerful commented on code in PR #4603:
URL: https://github.com/apache/calcite/pull/4603#discussion_r2464553672
##########
core/src/test/java/org/apache/calcite/tools/PlannerTest.java:
##########
@@ -1558,6 +1558,32 @@ private void assertValidPlan(String sql,
RelDataTypeSystem typeSystem,
assertThat(toString(root.rel), planMatcher);
}
+ @Test void test7239() throws Exception {
+ final String sql = "SELECT e1.*, d.deptno\n"
+ + "FROM emp e1 LEFT JOIN dept d\n"
+ + "ON e1.deptno = d.deptno\n"
+ + "AND d.deptno IN (\n"
+ + " SELECT e3.deptno FROM emp e3 WHERE d.deptno > e3.comm)\n"
+ + "ORDER BY e1.empno";
+ assertValidPlan2(sql, new VaryingTypeSystem(DelegatingTypeSystem.DEFAULT));
+ }
+
+ /** Asserts that a Planner generates the correct plan using the
+ * provided type system. */
+ private void assertValidPlan2(String sql, RelDataTypeSystem typeSystem)
+ throws SqlParseException, ValidationException, RelConversionException {
+ final SchemaPlus rootSchema = Frameworks.createRootSchema(true);
+ final FrameworkConfig config = Frameworks.newConfigBuilder()
+ .defaultSchema(
+ CalciteAssert.addSchema(rootSchema,
CalciteAssert.SchemaSpec.SCOTT))
+ .typeSystem(typeSystem).build();
+ final Planner planner = Frameworks.getPlanner(config);
+ SqlNode parse = planner.parse(sql);
+ final SqlNode validate = planner.validate(parse);
+ final RelRoot root = planner.relWithSubQueryRemoved(validate);
+ System.out.println(toString(root.rel));
Review Comment:
I just print the wrong plan here, without check yet
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]