tkalkirill commented on code in PR #783:
URL: https://github.com/apache/ignite-3/pull/783#discussion_r854970252
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/ddl/DdlSqlToCommandConverter.java:
##########
@@ -134,12 +163,23 @@ private CreateTableCommand
convertCreateTable(IgniteSqlCreateTable createTblNode
createTblCmd.schemaName(deriveSchemaName(createTblNode.name(), ctx));
createTblCmd.tableName(deriveObjectName(createTblNode.name(), ctx,
"tableName"));
createTblCmd.ifTableExists(createTblNode.ifNotExists());
+ createTblCmd.dataStorage(driveDataStorage(createTblNode.engineName(),
ctx));
if (createTblNode.createOptionList() != null) {
- for (SqlNode optNode : createTblNode.createOptionList().getList())
{
- IgniteSqlCreateTableOption opt = (IgniteSqlCreateTableOption)
optNode;
+ for (SqlNode optionNode :
createTblNode.createOptionList().getList()) {
+ IgniteSqlCreateTableOption option =
(IgniteSqlCreateTableOption) optionNode;
+
+ assert option.key().isSimple() : option.key();
+
+ String optionKey = option.key().getSimple();
- tblOptionProcessors.getOrDefault(opt.key(),
UNSUPPORTED_OPTION_PROCESSOR).process(opt, ctx, createTblCmd);
+ if (tableOptionInfos.containsKey(optionKey)) {
+ processTableOption(tableOptionInfos.get(optionKey),
option, ctx, createTblCmd);
+ } else if
(dataStorageOptionInfos.get(createTblCmd.dataStorage()).containsKey(optionKey))
{
+
processTableOption(dataStorageOptionInfos.get(createTblCmd.dataStorage()).get(optionKey),
option, ctx, createTblCmd);
+ } else {
+ throw new IgniteException(String.format("Unexpected table
option [option=%s, query=%s]", optionKey, ctx.query()));
Review Comment:
**IgniteInternalException** is not used in this class, I suggest setting it
that way for now.
--
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]