agura commented on code in PR #783:
URL: https://github.com/apache/ignite-3/pull/783#discussion_r855010794
##########
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))
{
Review Comment:
A storage engine should be infered from set of configuration, SET
default_engine command and ENGINE clause. Any engine's property should be
validated against available set of the inferred storage engine. There is no
sense to infer a storage engine from properties defined in WITH clause because
it is not transparent for an end user and different stroages can have the same
property name.
Infer gets a storage engine using the following priority:
- ENGINE clause - overrides all defaults, if defined
- default_engine - overrides configuration default, if defined
- defaultStroageEngine from configuration - in other cases (should always
be defined)
--
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]