chunweilei commented on a change in pull request #1690: [CALCITE-3524] Add 
methods for creating RexSubQueries in RelBuilder
URL: https://github.com/apache/calcite/pull/1690#discussion_r361353321
 
 

 ##########
 File path: core/src/test/java/org/apache/calcite/test/RelBuilderTest.java
 ##########
 @@ -3048,4 +3048,30 @@ private void checkExpandTable(RelBuilder builder, 
Matcher<RelNode> matcher) {
         + "    LogicalTableScan(table=[[scott, DEPT]])\n";
     assertThat(root, hasTree(expected));
   }
+
+  @Test public void testRexSubQueryIn() {
+
+    final RelBuilder builder = RelBuilder.create(config().build());
+    RelNode root = builder.scan("EMP")
+        .filter(
+            builder.in(
+                builder.scan("DEPT")
+                    .filter(
+                        builder.call(SqlStdOperatorTable.EQUALS,
+                            builder.field("DNAME"),
+                            builder.literal("AAA")))
+                    .project(builder.field("DEPTNO"))
+                    .build(),
+                ImmutableList.of(builder.field("DEPTNO"))))
+        .build();
+
 
 Review comment:
   Could you please add a comment about the equivalent sql for better 
understanding?

----------------------------------------------------------------
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

Reply via email to