You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2019/12/25 15:00:03 UTC

[GitHub] [calcite] agajst opened a new pull request #1690: [CALCITE-3524] Add methods for creating RexSubQueries in RelBuilder

agajst opened a new pull request #1690: [CALCITE-3524] Add methods for creating RexSubQueries in RelBuilder
URL: https://github.com/apache/calcite/pull/1690
 
 
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] jinxing64 commented on issue #1690: [CALCITE-3524] Add methods for creating RexSubQueries in RelBuilder

Posted by GitBox <gi...@apache.org>.
jinxing64 commented on issue #1690: [CALCITE-3524] Add methods for creating RexSubQueries in RelBuilder
URL: https://github.com/apache/calcite/pull/1690#issuecomment-569063900
 
 
   Why we don't make this change to RexBuilder ?
   Seems all the things are rex manipulation.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] amaliujia commented on a change in pull request #1690: [CALCITE-3524] Add methods for creating RexSubQueries in RelBuilder

Posted by GitBox <gi...@apache.org>.
amaliujia 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_r361390954
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/tools/RelBuilder.java
 ##########
 @@ -61,22 +61,14 @@
 import org.apache.calcite.rel.type.RelDataTypeFactory;
 import org.apache.calcite.rel.type.RelDataTypeField;
 import org.apache.calcite.rel.type.RelDataTypeFieldImpl;
-import org.apache.calcite.rex.RexBuilder;
-import org.apache.calcite.rex.RexCall;
-import org.apache.calcite.rex.RexCorrelVariable;
-import org.apache.calcite.rex.RexExecutor;
-import org.apache.calcite.rex.RexInputRef;
-import org.apache.calcite.rex.RexLiteral;
-import org.apache.calcite.rex.RexNode;
-import org.apache.calcite.rex.RexShuttle;
-import org.apache.calcite.rex.RexSimplify;
-import org.apache.calcite.rex.RexUtil;
+import org.apache.calcite.rex.*;
 import org.apache.calcite.runtime.Hook;
 
 Review comment:
   +1

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] chunweilei commented on a change in pull request #1690: [CALCITE-3524] Add methods for creating RexSubQueries in RelBuilder

Posted by GitBox <gi...@apache.org>.
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_r361353501
 
 

 ##########
 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());
 
 Review comment:
   Should delete this empty 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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] agajst commented on a change in pull request #1690: [CALCITE-3524] Add methods for creating RexSubQueries in RelBuilder

Posted by GitBox <gi...@apache.org>.
agajst 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_r361942518
 
 

 ##########
 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:
   done

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] agajst commented on a change in pull request #1690: [CALCITE-3524] Add methods for creating RexSubQueries in RelBuilder

Posted by GitBox <gi...@apache.org>.
agajst 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_r361942472
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/tools/RelBuilder.java
 ##########
 @@ -1053,6 +1045,29 @@ public RexNode patternExclude(RexNode node) {
         ImmutableList.of(node));
   }
 
+  // Methods that create RexSubQuery
+
+
+  /** Creates an IN sub-query. */
+  public RexSubQuery in(RelNode rel, ImmutableList<RexNode> nodes) {
+    return RexSubQuery.in(rel, nodes);
+  }
 
 Review comment:
   done

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] agajst commented on a change in pull request #1690: [CALCITE-3524] Add methods for creating RexSubQueries in RelBuilder

Posted by GitBox <gi...@apache.org>.
agajst 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_r361942571
 
 

 ##########
 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();
+
+    final String expected = "LogicalFilter(condition=[IN($7, {\n"
+        + "LogicalProject(DEPTNO=[$0])\n"
+        + "  LogicalFilter(condition=[=($1, 'AAA')])\n"
+        + "    LogicalTableScan(table=[[scott, DEPT]])\n"
+        + "})])\n"
+        + "  LogicalTableScan(table=[[scott, EMP]])\n";
+
 
 Review comment:
   done

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] agajst commented on a change in pull request #1690: [CALCITE-3524] Add methods for creating RexSubQueries in RelBuilder

Posted by GitBox <gi...@apache.org>.
agajst 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_r361942644
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/tools/RelBuilder.java
 ##########
 @@ -1053,6 +1045,29 @@ public RexNode patternExclude(RexNode node) {
         ImmutableList.of(node));
   }
 
+  // Methods that create RexSubQuery
+
+
 
 Review comment:
   done

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] amaliujia commented on a change in pull request #1690: [CALCITE-3524] Add methods for creating RexSubQueries in RelBuilder

Posted by GitBox <gi...@apache.org>.
amaliujia 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_r361391071
 
 

 ##########
 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();
+
+    final String expected = "LogicalFilter(condition=[IN($7, {\n"
+        + "LogicalProject(DEPTNO=[$0])\n"
+        + "  LogicalFilter(condition=[=($1, 'AAA')])\n"
+        + "    LogicalTableScan(table=[[scott, DEPT]])\n"
+        + "})])\n"
+        + "  LogicalTableScan(table=[[scott, EMP]])\n";
+
 
 Review comment:
   +1

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] jinxing64 commented on a change in pull request #1690: [CALCITE-3524] Add methods for creating RexSubQueries in RelBuilder

Posted by GitBox <gi...@apache.org>.
jinxing64 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_r361461525
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/tools/RelBuilder.java
 ##########
 @@ -1053,6 +1045,29 @@ public RexNode patternExclude(RexNode node) {
         ImmutableList.of(node));
   }
 
+  // Methods that create RexSubQuery
+
+
+  /** Creates an IN sub-query. */
+  public RexSubQuery in(RelNode rel, ImmutableList<RexNode> nodes) {
+    return RexSubQuery.in(rel, nodes);
+  }
 
 Review comment:
   +1

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] chunweilei commented on a change in pull request #1690: [CALCITE-3524] Add methods for creating RexSubQueries in RelBuilder

Posted by GitBox <gi...@apache.org>.
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_r361353547
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/tools/RelBuilder.java
 ##########
 @@ -1053,6 +1045,29 @@ public RexNode patternExclude(RexNode node) {
         ImmutableList.of(node));
   }
 
+  // Methods that create RexSubQuery
+
+
 
 Review comment:
   Should delete the empty 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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] chunweilei commented on a change in pull request #1690: [CALCITE-3524] Add methods for creating RexSubQueries in RelBuilder

Posted by GitBox <gi...@apache.org>.
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_r361352933
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/tools/RelBuilder.java
 ##########
 @@ -61,22 +61,14 @@
 import org.apache.calcite.rel.type.RelDataTypeFactory;
 import org.apache.calcite.rel.type.RelDataTypeField;
 import org.apache.calcite.rel.type.RelDataTypeFieldImpl;
-import org.apache.calcite.rex.RexBuilder;
-import org.apache.calcite.rex.RexCall;
-import org.apache.calcite.rex.RexCorrelVariable;
-import org.apache.calcite.rex.RexExecutor;
-import org.apache.calcite.rex.RexInputRef;
-import org.apache.calcite.rex.RexLiteral;
-import org.apache.calcite.rex.RexNode;
-import org.apache.calcite.rex.RexShuttle;
-import org.apache.calcite.rex.RexSimplify;
-import org.apache.calcite.rex.RexUtil;
+import org.apache.calcite.rex.*;
 import org.apache.calcite.runtime.Hook;
 
 Review comment:
   We'd better avoid import *

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] chunweilei commented on a change in pull request #1690: [CALCITE-3524] Add methods for creating RexSubQueries in RelBuilder

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] amaliujia commented on a change in pull request #1690: [CALCITE-3524] Add methods for creating RexSubQueries in RelBuilder

Posted by GitBox <gi...@apache.org>.
amaliujia 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_r361390954
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/tools/RelBuilder.java
 ##########
 @@ -61,22 +61,14 @@
 import org.apache.calcite.rel.type.RelDataTypeFactory;
 import org.apache.calcite.rel.type.RelDataTypeField;
 import org.apache.calcite.rel.type.RelDataTypeFieldImpl;
-import org.apache.calcite.rex.RexBuilder;
-import org.apache.calcite.rex.RexCall;
-import org.apache.calcite.rex.RexCorrelVariable;
-import org.apache.calcite.rex.RexExecutor;
-import org.apache.calcite.rex.RexInputRef;
-import org.apache.calcite.rex.RexLiteral;
-import org.apache.calcite.rex.RexNode;
-import org.apache.calcite.rex.RexShuttle;
-import org.apache.calcite.rex.RexSimplify;
-import org.apache.calcite.rex.RexUtil;
+import org.apache.calcite.rex.*;
 import org.apache.calcite.runtime.Hook;
 
 Review comment:
   +1. Import classes one by one.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] jinxing64 commented on a change in pull request #1690: [CALCITE-3524] Add methods for creating RexSubQueries in RelBuilder

Posted by GitBox <gi...@apache.org>.
jinxing64 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_r361461525
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/tools/RelBuilder.java
 ##########
 @@ -1053,6 +1045,29 @@ public RexNode patternExclude(RexNode node) {
         ImmutableList.of(node));
   }
 
+  // Methods that create RexSubQuery
+
+
+  /** Creates an IN sub-query. */
+  public RexSubQuery in(RelNode rel, ImmutableList<RexNode> nodes) {
+    return RexSubQuery.in(rel, nodes);
+  }
 
 Review comment:
   +1

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] agajst commented on a change in pull request #1690: [CALCITE-3524] Add methods for creating RexSubQueries in RelBuilder

Posted by GitBox <gi...@apache.org>.
agajst 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_r361942611
 
 

 ##########
 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());
 
 Review comment:
   done

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] agajst commented on a change in pull request #1690: [CALCITE-3524] Add methods for creating RexSubQueries in RelBuilder

Posted by GitBox <gi...@apache.org>.
agajst 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_r361941592
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/tools/RelBuilder.java
 ##########
 @@ -61,22 +61,14 @@
 import org.apache.calcite.rel.type.RelDataTypeFactory;
 import org.apache.calcite.rel.type.RelDataTypeField;
 import org.apache.calcite.rel.type.RelDataTypeFieldImpl;
-import org.apache.calcite.rex.RexBuilder;
-import org.apache.calcite.rex.RexCall;
-import org.apache.calcite.rex.RexCorrelVariable;
-import org.apache.calcite.rex.RexExecutor;
-import org.apache.calcite.rex.RexInputRef;
-import org.apache.calcite.rex.RexLiteral;
-import org.apache.calcite.rex.RexNode;
-import org.apache.calcite.rex.RexShuttle;
-import org.apache.calcite.rex.RexSimplify;
-import org.apache.calcite.rex.RexUtil;
+import org.apache.calcite.rex.*;
 import org.apache.calcite.runtime.Hook;
 
 Review comment:
   done
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] chunweilei commented on a change in pull request #1690: [CALCITE-3524] Add methods for creating RexSubQueries in RelBuilder

Posted by GitBox <gi...@apache.org>.
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_r361353459
 
 

 ##########
 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();
+
+    final String expected = "LogicalFilter(condition=[IN($7, {\n"
+        + "LogicalProject(DEPTNO=[$0])\n"
+        + "  LogicalFilter(condition=[=($1, 'AAA')])\n"
+        + "    LogicalTableScan(table=[[scott, DEPT]])\n"
+        + "})])\n"
+        + "  LogicalTableScan(table=[[scott, EMP]])\n";
+
 
 Review comment:
   Also add  tests about `RexSubQuery exists(RelNode rel)` and `RexSubQuery scalar(RelNode rel)`.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] jinxing64 edited a comment on issue #1690: [CALCITE-3524] Add methods for creating RexSubQueries in RelBuilder

Posted by GitBox <gi...@apache.org>.
jinxing64 edited a comment on issue #1690: [CALCITE-3524] Add methods for creating RexSubQueries in RelBuilder
URL: https://github.com/apache/calcite/pull/1690#issuecomment-569063900
 
 
   Why we don't put this change to RexBuilder ?
   Seems all the things are rex manipulation.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] chunweilei commented on a change in pull request #1690: [CALCITE-3524] Add methods for creating RexSubQueries in RelBuilder

Posted by GitBox <gi...@apache.org>.
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_r361353135
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/tools/RelBuilder.java
 ##########
 @@ -1053,6 +1045,29 @@ public RexNode patternExclude(RexNode node) {
         ImmutableList.of(node));
   }
 
+  // Methods that create RexSubQuery
+
+
+  /** Creates an IN sub-query. */
+  public RexSubQuery in(RelNode rel, ImmutableList<RexNode> nodes) {
+    return RexSubQuery.in(rel, nodes);
+  }
 
 Review comment:
   How about `Iterable<? extends RexNode> nodes`?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] jinxing64 commented on a change in pull request #1690: [CALCITE-3524] Add methods for creating RexSubQueries in RelBuilder

Posted by GitBox <gi...@apache.org>.
jinxing64 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_r361458253
 
 

 ##########
 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")
 
 Review comment:
   final ?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [calcite] agajst commented on a change in pull request #1690: [CALCITE-3524] Add methods for creating RexSubQueries in RelBuilder

Posted by GitBox <gi...@apache.org>.
agajst 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_r361942675
 
 

 ##########
 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")
 
 Review comment:
   done

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services