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/11/12 02:56:55 UTC

[GitHub] [calcite] yanlin-Lynn commented on a change in pull request #1568: [CALCITE-3486] In JDBC adapter, when generating ROW value expression, generates the ROW keyword only if the dialect allows it (quxiucheng)

yanlin-Lynn commented on a change in pull request #1568: [CALCITE-3486] In JDBC adapter, when generating ROW value expression, generates the ROW keyword only if the dialect allows it (quxiucheng)
URL: https://github.com/apache/calcite/pull/1568#discussion_r344998372
 
 

 ##########
 File path: core/src/test/java/org/apache/calcite/sql/parser/SqlParserTest.java
 ##########
 @@ -1159,6 +1159,36 @@ protected boolean isUnparserTest() {
         .ok("SELECT ((`TBL`.`FOO`(0).`COL`).`BAR`)\nFROM `TBL`");
   }
 
+  @Test public void testRowValueExpression() {
+    String expected = "INSERT INTO \"EMPS\"\n"
+            + "VALUES (ROW(1, 'Fred')),\n"
+            + "(ROW(2, 'Eric'))";
+    sql("insert into emps values ROW(1,'Fred'),ROW(2, 'Eric')")
+            .withDialect(SqlDialect.DatabaseProduct.CALCITE.getDialect())
+            .ok(expected);
+
+    expected = "INSERT INTO `emps`\n"
+            + "VALUES (1, 'Fred'),\n"
+            + "(2, 'Eric')";
+    sql("insert into emps values (1,'Fred'),(2, 'Eric')")
 
 Review comment:
   I think you should use the same text in sql(), and check both for 
   `sql("insert into emps values ROW(1,'Fred'),ROW(2, 'Eric')")`
   and
   `sql("insert into emps values (1,'Fred'),(2, 'Eric')")`

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