You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "alex-plekhanov (via GitHub)" <gi...@apache.org> on 2023/01/23 11:55:23 UTC

[GitHub] [ignite] alex-plekhanov commented on a diff in pull request #10479: IGNITE-18511 Added details to Calcite parser exception

alex-plekhanov commented on code in PR #10479:
URL: https://github.com/apache/ignite/pull/10479#discussion_r1083965015


##########
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/TableDdlIntegrationTest.java:
##########
@@ -281,6 +281,24 @@ public void createTableIfNotExists() {
         sql("create table if not exists my_table (id int, val varchar)");
     }
 
+    /**
+     * Create table using reserved word
+     */
+    @Test
+    public void createTableUseReservedWord() {
+        assertThrows("create table table (id int primary key, val varchar)", IgniteSQLException.class,
+            "Was expecting one of:");
+
+        sql("create table \"table\" (id int primary key, val varchar)");
+
+        sql("insert into \"table\" (id, val) values (0, '1')");
+
+        List<List<?>> res = sql("select * from \"table\" ");
+
+        assertEquals(1, res.size());
+        assertEquals(2, res.get(0).size());

Review Comment:
   `assertQuery("select * from \"table\" ").returns(0, "1").check()`



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

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org