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/31 04:07:02 UTC

[GitHub] [calcite] xy2953396112 opened a new pull request #1709: [CALCITE-3570] TableModify convert to Logical in ToLogicalConverter

xy2953396112 opened a new pull request #1709: [CALCITE-3570] TableModify convert to Logical in ToLogicalConverter
URL: https://github.com/apache/calcite/pull/1709
 
 
   Support TableModify convert to Logical in ToLogicalConverter

----------------------------------------------------------------
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] hsyuan merged pull request #1709: [CALCITE-3653] Support TableModify in ToLogicalConverter

Posted by GitBox <gi...@apache.org>.
hsyuan merged pull request #1709: [CALCITE-3653] Support TableModify in ToLogicalConverter
URL: https://github.com/apache/calcite/pull/1709
 
 
   

----------------------------------------------------------------
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] xy2953396112 commented on issue #1709: [CALCITE-3653] Support TableModify in ToLogicalConverter

Posted by GitBox <gi...@apache.org>.
xy2953396112 commented on issue #1709: [CALCITE-3653] Support TableModify in ToLogicalConverter
URL: https://github.com/apache/calcite/pull/1709#issuecomment-574563403
 
 
   @jinxing64 @danny0405 @chunweilei  Thanks for you review.

----------------------------------------------------------------
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] danny0405 commented on a change in pull request #1709: [CALCITE-3653] Support TableModify in ToLogicalConverter

Posted by GitBox <gi...@apache.org>.
danny0405 commented on a change in pull request #1709: [CALCITE-3653] Support TableModify in ToLogicalConverter
URL: https://github.com/apache/calcite/pull/1709#discussion_r366708684
 
 

 ##########
 File path: core/src/test/java/org/apache/calcite/rel/logical/ToLogicalConverterTest.java
 ##########
 @@ -468,4 +468,19 @@ private void verify(RelNode rel, String expectedPhysical, String expectedLogical
             + "    LogicalTableScan(table=[[foodmart, employee]])\n";
     verify(rel(sql), expectedPhysial, expectedLogical);
   }
+
+  @Test public void testTableModify() {
+    String sql = "insert into \"employee\" select * from \"employee\"";
+    RelNode rel = rel(sql);
+    String expectedPhysial = ""
+        + "JdbcToEnumerableConverter\n"
+        + "  JdbcTableModify(table=[[foodmart, employee]], operation=[INSERT], flattened=[true])\n"
+        + "    JdbcTableScan(table=[[foodmart, employee]])\n";
+    String expectedLogical = ""
+        + "LogicalTableModify(table=[[foodmart, employee]], "
+        + "operation=[INSERT], flattened=[true])\n"
+        + "  LogicalTableScan(table=[[foodmart, employee]])\n";
+    verify(rel, expectedPhysial, expectedLogical);
+  }
 
 Review comment:
   Inline the `rel(sql)`.

----------------------------------------------------------------
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 #1709: [CALCITE-3653] TableModify convert to Logical in ToLogicalConverter

Posted by GitBox <gi...@apache.org>.
jinxing64 commented on issue #1709: [CALCITE-3653] TableModify convert to Logical in ToLogicalConverter
URL: https://github.com/apache/calcite/pull/1709#issuecomment-569880814
 
 
   How about we update the title as 
   `Support TableModify in ToLogicalConverter `

----------------------------------------------------------------
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] xy2953396112 commented on a change in pull request #1709: [CALCITE-3653] TableModify convert to Logical in ToLogicalConverter

Posted by GitBox <gi...@apache.org>.
xy2953396112 commented on a change in pull request #1709: [CALCITE-3653] TableModify convert to Logical in ToLogicalConverter
URL: https://github.com/apache/calcite/pull/1709#discussion_r362157401
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/rel/logical/ToLogicalConverter.java
 ##########
 @@ -150,6 +151,15 @@ public ToLogicalConverter(RelBuilder relBuilder) {
       return LogicalCalc.create(visit(calc.getInput()), calc.getProgram());
     }
 
+    if (relNode instanceof TableModify) {
+      final TableModify tableModify = (TableModify) relNode;
+      final RelNode input = visit(tableModify.getInput());
+      return new LogicalTableModify(tableModify.getCluster(), tableModify.getTraitSet(),
 
 Review comment:
   Thanks for review, I think `new LogicalTableModify` and `LogicalTableModify#create` are equivalent. but it seems like that we use `LogicalTableModify#create` more better.

----------------------------------------------------------------
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 #1709: [CALCITE-3653] TableModify convert to Logical in ToLogicalConverter

Posted by GitBox <gi...@apache.org>.
jinxing64 commented on a change in pull request #1709: [CALCITE-3653] TableModify convert to Logical in ToLogicalConverter
URL: https://github.com/apache/calcite/pull/1709#discussion_r362154843
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/rel/logical/ToLogicalConverter.java
 ##########
 @@ -150,6 +151,15 @@ public ToLogicalConverter(RelBuilder relBuilder) {
       return LogicalCalc.create(visit(calc.getInput()), calc.getProgram());
     }
 
+    if (relNode instanceof TableModify) {
+      final TableModify tableModify = (TableModify) relNode;
+      final RelNode input = visit(tableModify.getInput());
+      return new LogicalTableModify(tableModify.getCluster(), tableModify.getTraitSet(),
 
 Review comment:
   Shall we  use `LogicalTableModify#create` ?

----------------------------------------------------------------
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] xy2953396112 commented on a change in pull request #1709: [CALCITE-3653] Support TableModify in ToLogicalConverter

Posted by GitBox <gi...@apache.org>.
xy2953396112 commented on a change in pull request #1709: [CALCITE-3653] Support TableModify in ToLogicalConverter
URL: https://github.com/apache/calcite/pull/1709#discussion_r366715500
 
 

 ##########
 File path: core/src/test/java/org/apache/calcite/rel/logical/ToLogicalConverterTest.java
 ##########
 @@ -468,4 +468,19 @@ private void verify(RelNode rel, String expectedPhysical, String expectedLogical
             + "    LogicalTableScan(table=[[foodmart, employee]])\n";
     verify(rel(sql), expectedPhysial, expectedLogical);
   }
+
+  @Test public void testTableModify() {
+    String sql = "insert into \"employee\" select * from \"employee\"";
+    RelNode rel = rel(sql);
+    String expectedPhysial = ""
+        + "JdbcToEnumerableConverter\n"
+        + "  JdbcTableModify(table=[[foodmart, employee]], operation=[INSERT], flattened=[true])\n"
+        + "    JdbcTableScan(table=[[foodmart, employee]])\n";
+    String expectedLogical = ""
+        + "LogicalTableModify(table=[[foodmart, employee]], "
+        + "operation=[INSERT], flattened=[true])\n"
+        + "  LogicalTableScan(table=[[foodmart, employee]])\n";
+    verify(rel, expectedPhysial, expectedLogical);
+  }
 
 Review comment:
   > Inline the `rel(sql)`.
   
   Thanks for you review, i have updated it.

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