xtern commented on code in PR #1385:
URL: https://github.com/apache/ignite-3/pull/1385#discussion_r1037183205
##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/exec/MockedStructuresTest.java:
##########
@@ -275,6 +285,58 @@ private void mockMetastore() throws Exception {
when(cursorMocked.iterator()).thenReturn(itMock);
}
+ @Test
+ public void testCreateZone() {
+ String mtdName = getCurrentMethodName();
+
+ String query = String.format("CREATE ZONE %s", mtdName);
+
+ // Create new distribution zone.
+ readFirst(queryProc.queryAsync("PUBLIC", query));
+
+ // Create distribution zone with existing name.
+ IgniteException ex = assertThrows(IgniteException.class, () ->
readFirst(queryProc.queryAsync("PUBLIC", query)));
+ assertTrue(hasCause(ex, DistributionZoneAlreadyExistsException.class,
null));
+
+ // Check ifNotExists flag.
+ readFirst(queryProc.queryAsync("PUBLIC", String.format("CREATE ZONE IF
NOT EXISTS %s", mtdName)));
+ }
+
+ @Test
+ public void testCreateZoneOptions() {
+ String mtdName = getCurrentMethodName();
+
+ // Check for conflicting options.
+ String qry0 = String.format("CREATE ZONE %s WITH
DATA_NODES_AUTO_ADJUST=10, DATA_NODES_AUTO_ADJUST_SCALE_UP=5", mtdName);
Review Comment:
We already have such a test -
`DistributionZoneSqlToCommandConverterTest#createWithDuplicateOptions`
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]