korlov42 commented on code in PR #6712:
URL: https://github.com/apache/ignite-3/pull/6712#discussion_r2451731412
##########
modules/catalog/src/main/java/org/apache/ignite/internal/catalog/commands/CreateTableCommand.java:
##########
@@ -127,13 +139,36 @@ public List<UpdateEntry> get(UpdateContext updateContext)
{
ensureNoTableIndexOrSysViewExistsWithGivenName(schema, tableName);
+ int id = catalog.objectIdGenState();
+ int tableId = id++;
+ int pkIndexId = id++;
+
+ // We will have at max 5 entries if there is lazy default data zone
creation action is needed.
+ List<UpdateEntry> updateEntries = new ArrayList<>(5);
+
CatalogZoneDescriptor zone;
if (zoneName == null) {
if (catalog.defaultZone() == null) {
- throw new CatalogValidationException("The zone is not
specified. Please specify zone explicitly or set default one.");
+ int zoneId = id++;
+
+ zone = new CatalogZoneDescriptor(
Review Comment:
tbh, I'm not a big fun a modifying existing tests as it easy to miss
something or even accidentally broke old tests.
Let's add minimal tests for following scenarios:
- a new zone create lazily on a table creation
- a new zone _is not_ created when there is already exists default
- table is created successfully when default zone is not set, but there is
non default one with name equal to `DEFAULT_ZONE_NAME`. Catalog must not have
multiple zones with similar name
--
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]