korlov42 commented on code in PR #5451:
URL: https://github.com/apache/ignite-3/pull/5451#discussion_r2020496976


##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/sql/DistributionZoneWithKeywordSyntaxSqlDdlParserTest.java:
##########
@@ -0,0 +1,150 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.sql.engine.sql;
+
+import static 
org.apache.ignite.internal.sql.engine.sql.DistributionZoneSqlDdlParserTest.assertThatZoneOptionPresent;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertInstanceOf;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import java.util.List;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.ignite.internal.sql.engine.prepare.ddl.ZoneOptionEnum;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Tests to verify parsing of the DDL "ZONE" commands contains WITH syntax.
+ */
+public class DistributionZoneWithKeywordSyntaxSqlDdlParserTest extends 
AbstractParserTest {

Review Comment:
   `DistributionZoneWithKeywordSyntaxSqlDdlParserTest` -> 
`DistributionZoneObsoleteSyntaxSqlDdlParserTest `
   
   we must make it clear that this syntax is obsolete and no one should use it



##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/sql/IgniteSqlCreateZone.java:
##########
@@ -50,25 +54,29 @@ public SqlCall createCall(@Nullable SqlLiteral 
functionQualifier,
                 SqlParserPos pos, @Nullable SqlNode... operands) {
 
             return new IgniteSqlCreateZone(pos, existFlag(), (SqlIdentifier) 
operands[0],
-                    (SqlNodeList) operands[1]);
+                    (SqlNodeList) operands[1], (SqlNodeList) operands[2]);
         }
     }
 
     private final SqlIdentifier name;
 
     private final @Nullable SqlNodeList createOptionList;
 
+    private final SqlNodeList storageProfiles;
+
     /** Creates a SqlCreateZone. */
     public IgniteSqlCreateZone(
             SqlParserPos pos,
             boolean ifNotExists,
             SqlIdentifier name,
-            @Nullable SqlNodeList createOptionList
+            @Nullable SqlNodeList createOptionList,
+            @Nullable SqlNodeList storageProfiles

Review Comment:
   `storageProfiles` must not be null



##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/ddl/ZoneOptionEnum.java:
##########
@@ -46,5 +49,17 @@ public enum ZoneOptionEnum {
     STORAGE_PROFILES,
 
     /** Consistency mode. */
-    CONSISTENCY_MODE
+    CONSISTENCY_MODE;
+
+    public static final Map<ZoneOptionEnum, String> OPTIONS_MAPPING = Map.of(
+            PARTITIONS, "PARTITIONS",
+            REPLICAS, "REPLICAS",
+            DISTRIBUTION_ALGORITHM, "DISTRIBUTION ALGORITHM",
+            DATA_NODES_FILTER, "NODES FILTER",
+            DATA_NODES_AUTO_ADJUST, "AUTO ADJUST",
+            DATA_NODES_AUTO_ADJUST_SCALE_UP, "AUTO SCALE UP",
+            DATA_NODES_AUTO_ADJUST_SCALE_DOWN, "AUTO SCALE DOWN",
+            CONSISTENCY_MODE, "CONSISTENCY MODE",
+            STORAGE_PROFILES, "STORAGE PROFILES"

Review Comment:
   storage profiles is mandatory property, it should not be an option



-- 
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-unsubscr...@ignite.apache.org

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

Reply via email to