xtern commented on code in PR #1385:
URL: https://github.com/apache/ignite-3/pull/1385#discussion_r1037186197
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/ddl/DdlSqlToCommandConverter.java:
##########
@@ -97,16 +108,23 @@ public class DdlSqlToCommandConverter {
private final Map<String, String> dataStorageNames;
/**
- * Mapping: Table option ID -> table option info.
+ * Mapping: Table option ID -> DDL command updater.
*
* <p>Example for "replicas": {@code Map.of("REPLICAS",
TableOptionInfo@123)}.
*/
- private final Map<String, TableOptionInfo<?>> tableOptionInfos;
+ private final Map<String, DdlCommandOptionUpdater<CreateTableCommand, ?>>
tableOptionUpdaters;
/**
- * Like {@link #tableOptionInfos}, but for each data storage name.
+ * Like {@link #tableOptionUpdaters}, but for each data storage name.
*/
- private final Map<String, Map<String, TableOptionInfo<?>>>
dataStorageOptionInfos;
+ private final Map<String, Map<String,
DdlCommandOptionUpdater<CreateTableCommand, ?>>> dataStorageOptionUpdaters;
+
+ /**
+ * Mapping: Zone option ID -> DDL command updater.
+ *
+ * <p>Example for "replicas": {@code Map.of("REPLICAS",
TableOptionInfo@123)}.
Review Comment:
Fixed, thanks.
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/ddl/DdlSqlToCommandConverter.java:
##########
@@ -438,6 +480,61 @@ private DropIndexCommand
convertDropIndex(IgniteSqlDropIndex sqlCmd, PlanningCon
return dropCmd;
}
+ /**
+ * Converts a given CreateZone AST to a CreateZone command.
+ *
+ * @param createZoneNode Root node of the given AST.
+ * @param ctx Planning context.
+ */
+ private CreateZoneCommand convertCreateZone(IgniteSqlCreateZone
createZoneNode, PlanningContext ctx) {
+ CreateZoneCommand createZoneCmd = new CreateZoneCommand();
+
+ createZoneCmd.schemaName(deriveSchemaName(createZoneNode.name(), ctx));
+ createZoneCmd.zoneName(deriveObjectName(createZoneNode.name(), ctx,
"zoneName"));
+ createZoneCmd.ifZoneExists(createZoneNode.ifNotExists());
Review Comment:
Fixed, thanks.
--
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]