You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/03/14 16:00:18 UTC

[GitHub] [ignite-3] korlov42 commented on a change in pull request #711: IGNITE-16591 DDL syntax COLOCATE BY

korlov42 commented on a change in pull request #711:
URL: https://github.com/apache/ignite-3/pull/711#discussion_r826119446



##########
File path: modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/sql/SqlDdlParserTest.java
##########
@@ -214,6 +217,52 @@ public void createTableWithOptions() throws SqlParseException {
         assertThatIntegerOptionPresent(createTable.createOptionList().getList(), "PARTITIONS", 3);
     }
 
+    /**
+     * Parsing of CREATE TABLE with specified colocation columns.
+     */
+    @Test
+    public void createTableWithColocation() throws SqlParseException {
+        IgniteSqlCreateTable createTable;
+
+        createTable = parseCreateTable(
+                "CREATE TABLE MY_TABLE(ID0 INT, ID1 INT, ID2 INT, VAL INT, PRIMARY KEY (ID0, ID1, ID2))"
+        );
+
+        assertNull(createTable.colocationColumns());
+
+        createTable = parseCreateTable(
+                "CREATE TABLE MY_TABLE(ID0 INT, ID1 INT, ID2 INT, VAL INT, PRIMARY KEY (ID0, ID1, ID2)) COLOCATE BY (ID2, ID1)"
+        );
+
+        assertThat(
+                createTable.colocationColumns().getList().stream()
+                .map(SqlIdentifier.class::cast)
+                .map(SqlIdentifier::getSimple)
+                .collect(Collectors.toList()),

Review comment:
       ```suggestion
                           .map(SqlIdentifier.class::cast)
                           .map(SqlIdentifier::getSimple)
                           .collect(Collectors.toList()),
   ```




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