julianhyde commented on a change in pull request #1110: [CALCITE-2920]
RelBuilder: new method to create an antijoin
URL: https://github.com/apache/calcite/pull/1110#discussion_r266184088
##########
File path:
core/src/test/java/org/apache/calcite/test/enumerable/EnumerableCorrelateTest.java
##########
@@ -133,6 +134,37 @@
"empid=200");
}
+
+ /** Test case for
+ * <a
href="https://issues.apache.org/jira/browse/CALCITE-2920">[CALCITE-2920]
+ * RelBuilder: new method to create an antijoin</a> */
+ @Ignore("Using withRel causes the forceDecorrelate=false property to be
lost")
+ @Test public void antiJoinCorrelate() {
+ tester(false, new JdbcTest.HrSchema())
+ .query("?")
+ .withRel(
+ // Retrieve departments without employees. Equivalent SQL:
+ // SELECT d.deptno, d.name FROM depts d
+ // WHERE NOT EXISTS (SELECT 1 FROM emps e WHERE e.deptno =
d.deptno)
+ // ORDER by d.deptno
+ builder -> builder
+ .scan("s", "depts").as("d")
+ .scan("s", "emps").as("e")
+ .antiJoin(
+ builder.equals(
+ builder.field(2, "d", "deptno"),
+ builder.field(2, "e", "deptno")))
+ .project(
+ builder.field("deptno"),
+ builder.field("name"))
+ .sort(builder.field("deptno"))
+ .build()
+ )
Review comment:
close parens should not be on their own line
----------------------------------------------------------------
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