korlov42 commented on a change in pull request #309:
URL: https://github.com/apache/ignite-3/pull/309#discussion_r704136628
##########
File path: modules/calcite/src/main/codegen/includes/parserImpls.ftl
##########
@@ -43,27 +43,9 @@ SqlLiteral CreateTableOptionKey() :
{
}
{
- <TEMPLATE> { return
SqlLiteral.createSymbol(IgniteSqlCreateTableOptionEnum.TEMPLATE, getPos()); }
-|
<BACKUPS> { return
SqlLiteral.createSymbol(IgniteSqlCreateTableOptionEnum.BACKUPS, getPos()); }
Review comment:
Currently this param is called `REPLICAS`.
BTW the only param not covered here is `PARTITIONS`. Probably, it worth to
add it.
WDYT?
##########
File path: modules/calcite/src/main/codegen/includes/parserImpls.ftl
##########
@@ -43,27 +43,9 @@ SqlLiteral CreateTableOptionKey() :
{
}
{
- <TEMPLATE> { return
SqlLiteral.createSymbol(IgniteSqlCreateTableOptionEnum.TEMPLATE, getPos()); }
-|
<BACKUPS> { return
SqlLiteral.createSymbol(IgniteSqlCreateTableOptionEnum.BACKUPS, getPos()); }
-|
- <AFFINITY_KEY> { return
SqlLiteral.createSymbol(IgniteSqlCreateTableOptionEnum.AFFINITY_KEY, getPos());
}
-|
- <ATOMICITY> { return
SqlLiteral.createSymbol(IgniteSqlCreateTableOptionEnum.ATOMICITY, getPos()); }
-|
- <WRITE_SYNCHRONIZATION_MODE> { return
SqlLiteral.createSymbol(IgniteSqlCreateTableOptionEnum.WRITE_SYNCHRONIZATION_MODE,
getPos()); }
-|
- <CACHE_GROUP> { return
SqlLiteral.createSymbol(IgniteSqlCreateTableOptionEnum.CACHE_GROUP, getPos()); }
-|
- <CACHE_NAME> { return
SqlLiteral.createSymbol(IgniteSqlCreateTableOptionEnum.CACHE_NAME, getPos()); }
-|
- <DATA_REGION> { return
SqlLiteral.createSymbol(IgniteSqlCreateTableOptionEnum.DATA_REGION, getPos()); }
|
<KEY_TYPE> { return
SqlLiteral.createSymbol(IgniteSqlCreateTableOptionEnum.KEY_TYPE, getPos()); }
Review comment:
`KEY_TYPE` should be removed too
##########
File path:
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/prepare/ddl/DdlSqlToCommandConverter.java
##########
@@ -153,22 +140,33 @@ private CreateTableCommand
convertCreateTable(IgniteSqlCreateTable createTblNode
IgnitePlanner planner = ctx.planner();
- List<ColumnDefinition> cols = new ArrayList<>();
+ Column[] cols = new Column[colDeclarations.size()];
+
+ int colPos = 0;
+
+ IgniteTypeFactory typeFactory = ctx.typeFactory();
for (SqlColumnDeclaration col : colDeclarations) {
if (!col.name.isSimple())
throw new IgniteException("Unexpected value of columnName [" +
"expected a simple identifier, but was " + col.name + "; "
+
- "querySql=\"" + ctx.query() + "\"]"/*,
IgniteQueryErrorCode.PARSING*/);
+ "querySql=\"" + ctx.query() + "\"]");
String name = col.name.getSimple();
- RelDataType type = planner.convert(col.dataType);
+
+ RelDataType relType = planner.convert(col.dataType);
Object dflt = null;
if (col.expression != null)
dflt = ((SqlLiteral)col.expression).getValue();
- cols.add(new ColumnDefinition(name, type, dflt));
Review comment:
the comment is marked as resolved whereas neither changes nor reasons
not to do so were provided
--
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]