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 2020/11/18 08:56:54 UTC

[GitHub] [calcite] xy2953396112 opened a new pull request #2270: [CALCITE-4407] Support unparse special syntax when operator is DELETE…

xy2953396112 opened a new pull request #2270:
URL: https://github.com/apache/calcite/pull/2270


   … (xzh)
   https://issues.apache.org/jira/projects/CALCITE/issues/CALCITE-4407


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



[GitHub] [calcite] julianhyde commented on a change in pull request #2270: [CALCITE-4407] Support unparse special syntax when operator is DELETE…

Posted by GitBox <gi...@apache.org>.
julianhyde commented on a change in pull request #2270:
URL: https://github.com/apache/calcite/pull/2270#discussion_r526317610



##########
File path: core/src/test/java/org/apache/calcite/sql/parser/SqlParserTest.java
##########
@@ -6186,6 +6186,31 @@ public void subTestIntervalDayFailsValidation() {
     assertEquals(linux(sqlNodeVisited1.toString()), str1);
   }
 
+  @Test void testSqlDeleteSqlBasicCallToString() throws Exception {

Review comment:
       the name of the test is misleading. you are not calling toString on a SqlBasicCall.




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



[GitHub] [calcite] julianhyde commented on a change in pull request #2270: [CALCITE-4407] Support unparse special syntax when operator is DELETE…

Posted by GitBox <gi...@apache.org>.
julianhyde commented on a change in pull request #2270:
URL: https://github.com/apache/calcite/pull/2270#discussion_r526317081



##########
File path: core/src/test/java/org/apache/calcite/sql/parser/SqlParserTest.java
##########
@@ -6186,6 +6186,31 @@ public void subTestIntervalDayFailsValidation() {
     assertEquals(linux(sqlNodeVisited1.toString()), str1);
   }
 
+  @Test void testSqlDeleteSqlBasicCallToString() throws Exception {
+    final String sql0 = "delete from emps where empno = 1";
+    final SqlNode sqlNode0 = getSqlParser(sql0).parseStmt();
+    final SqlNode sqlNodeVisited0 = sqlNode0.accept(new SqlShuttle() {
+      @Override public SqlNode visit(SqlIdentifier identifier) {
+        return new SqlIdentifier(identifier.names,
+            identifier.getParserPosition());
+      }
+    });
+    final String str0 = "DELETE FROM `EMPS`\n"
+        + "WHERE `EMPNO` = 1";
+    assertEquals(linux(sqlNodeVisited0.toString()), str0);

Review comment:
       we don't use assertEquals. because people get the args in the wrong order. as you did.




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



[GitHub] [calcite] xy2953396112 closed pull request #2270: [CALCITE-4407] Support unparse special syntax when operator is DELETE…

Posted by GitBox <gi...@apache.org>.
xy2953396112 closed pull request #2270:
URL: https://github.com/apache/calcite/pull/2270


   


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



[GitHub] [calcite] vlsi commented on a change in pull request #2270: [CALCITE-4407] Support unparse special syntax when operator is DELETE…

Posted by GitBox <gi...@apache.org>.
vlsi commented on a change in pull request #2270:
URL: https://github.com/apache/calcite/pull/2270#discussion_r526448125



##########
File path: core/src/main/java/org/apache/calcite/sql/SqlDelete.java
##########
@@ -30,7 +30,12 @@
  */
 public class SqlDelete extends SqlCall {
   public static final SqlSpecialOperator OPERATOR =
-      new SqlSpecialOperator("DELETE", SqlKind.DELETE);
+      new SqlSpecialOperator("DELETE", SqlKind.DELETE) {
+        @Override public SqlCall createCall(SqlLiteral functionQualifier,
+            SqlParserPos pos, SqlNode... operands) {
+          return new SqlDelete(pos, operands[0], operands[1], null, null);

Review comment:
       Why is this `null`, `null` rather than `operands[2]` and `operands[3]`?




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