korlov42 commented on code in PR #3508:
URL: https://github.com/apache/ignite-3/pull/3508#discussion_r1544246882
##########
modules/sql-engine/src/main/codegen/includes/parserImpls.ftl:
##########
@@ -48,7 +48,11 @@ void CreateTableOption(List<SqlNode> list) :
{
key = SimpleIdentifier() { s = span(); }
<EQ>
- val = Literal()
+ (
+ val = Literal()
+ |
+ val = SimpleIdentifier()
Review Comment:
it would be nice to cover new grammar with unit tests on parsing. Please
refer to `org.apache.ignite.internal.sql.engine.sql.SqlDdlParserTest` for
examples.
There is also
`org.apache.ignite.internal.sql.engine.prepare.ddl.DdlSqlToCommandConverterTest`
to verify conversion from syntax tree to command
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/ddl/DdlSqlToCommandConverter.java:
##########
@@ -782,40 +782,74 @@ private String deriveDataStorage(@Nullable SqlIdentifier
engineName, PlanningCon
private <S, T> void updateCommandOption(
String sqlObjName,
Object optId,
- SqlLiteral value,
+ SqlNode value,
DdlOptionInfo<S, T> optInfo,
String query,
S target
) {
- T value0;
+ T expectedValue = extractValueForUpdateCommandOption(sqlObjName,
optId, value, optInfo, query);
+ validateValue(sqlObjName, optId, optInfo, query, expectedValue);
+ optInfo.setter.accept(target, expectedValue);
+ }
+
+ private static <T, S> T extractValueForUpdateCommandOption(
+ String sqlObjName,
+ Object optId,
+ SqlNode value,
+ DdlOptionInfo<S, T> optInfo,
+ String query
+ ) {
+ var valueKind = value.getKind();
Review Comment:
it's not allowed to use `var` in such context. Please refer to our [coding
guideline](https://cwiki.apache.org/confluence/display/IGNITE/Java+Code+Style+Guide#JavaCodeStyleGuide-3Usingvarkeyword)
page to learn more
--
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]