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


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/sql/IgniteSqlZoneOption.java:
##########
@@ -18,19 +18,34 @@
 package org.apache.ignite.internal.sql.engine.sql;
 
 import java.util.List;
+import java.util.Map;
 import org.apache.calcite.sql.SqlCall;
+import org.apache.calcite.sql.SqlCharStringLiteral;
 import org.apache.calcite.sql.SqlIdentifier;
 import org.apache.calcite.sql.SqlKind;
 import org.apache.calcite.sql.SqlLiteral;
 import org.apache.calcite.sql.SqlNode;
 import org.apache.calcite.sql.SqlOperator;
 import org.apache.calcite.sql.SqlWriter;
+import org.apache.calcite.sql.SqlWriter.FrameTypeEnum;
 import org.apache.calcite.sql.parser.SqlParserPos;
 import org.apache.calcite.util.Litmus;
+import org.apache.ignite.internal.sql.engine.prepare.ddl.ZoneOptionEnum;
 import org.checkerframework.checker.nullness.qual.Nullable;
 
 /** An AST node representing option in CREATE ZONE and ALTER ZONE statements. 
*/
 public class IgniteSqlZoneOption extends SqlCall {
+    public static final Map<ZoneOptionEnum, String> OPTIONS_MAPPING = Map.of(

Review Comment:
   It can be part of ZoneOptionEnum. WDYT?



##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/prepare/ddl/DistributionZoneSqlToCommandConverterTest.java:
##########
@@ -111,10 +120,16 @@ public void 
testCreateZoneWithConsistencyModeStrongConsistency() throws SqlParse
         assertThat(desc.consistencyMode(), 
equalTo(ConsistencyMode.STRONG_CONSISTENCY));
     }
 
-    @Test
-    public void testCreateZoneWithConsistencyModeHighAvailability() throws 
SqlParseException {
-        SqlNode node = parse("CREATE ZONE test0 WITH STORAGE_PROFILES='" + 
DEFAULT_STORAGE_PROFILE + "',"
-                + " CONSISTENCY_MODE='" + 
ConsistencyMode.HIGH_AVAILABILITY.name() + "'");
+    @ParameterizedTest(name = "with syntax = {0}")
+    @ValueSource(booleans = {true, false})
+    public void testCreateZoneWithConsistencyModeHighAvailability(boolean 
withPresent) throws SqlParseException {
+        String sql = withPresent
+                ? "CREATE ZONE test WITH STORAGE_PROFILES='" + 
DEFAULT_STORAGE_PROFILE + "',"
+                        + " CONSISTENCY_MODE='" + 
ConsistencyMode.HIGH_AVAILABILITY.name() + "'"
+                : "CREATE ZONE test (CONSISTENCY MODE '" + 
ConsistencyMode.HIGH_AVAILABILITY.name() + "') "

Review Comment:
   ```suggestion
           String sql = withPresent
                   ? "CREATE ZONE test WITH STORAGE_PROFILES='" + 
DEFAULT_STORAGE_PROFILE + "',"
                           + " CONSISTENCY_MODE='" + 
ConsistencyMode.HIGH_AVAILABILITY + "'"
                   : "CREATE ZONE test (CONSISTENCY MODE '" + 
ConsistencyMode.HIGH_AVAILABILITY + "') "
   ```



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