lowka commented on code in PR #5450:
URL: https://github.com/apache/ignite-3/pull/5450#discussion_r2016145654


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/ddl/DdlSqlToCommandConverter.java:
##########
@@ -562,25 +555,40 @@ private CatalogCommand 
convertAlterColumn(IgniteSqlAlterColumn alterColumnNode,
             builder.nullable(!notNull);
         }
 
-        if (alterColumnNode.expression() != null) {
-            SqlNode expr = alterColumnNode.expression();
+        SqlNode defaultExpr = alterColumnNode.expression();
+        if (defaultExpr != null) {
+            String columnName = alterColumnNode.name().getSimple();
+            Pair<DefaultValue.Type, DeferredDefaultValue> resolveDfltFunc = 
convertDefaultExpression(defaultExpr, columnName, relType);
 
-            DeferredDefaultValue resolveDfltFunc;
+            if (resolveDfltFunc.getFirst() != Type.CONSTANT) {
+                throw new SqlException(STMT_VALIDATION_ERR, "Cannot set 
functional default: " + defaultExpr);

Review Comment:
   I agree with you on both points. 



-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to