tkalkirill commented on code in PR #2136:
URL: https://github.com/apache/ignite-3/pull/2136#discussion_r1214210448


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/schema/NonHistoricSchemas.java:
##########
@@ -104,7 +106,16 @@ public static TableColumnDescriptor 
columnDescriptor(Column column) {
                 column.name(),
                 column.type().spec().asColumnType(),
                 column.nullable(),
-                DefaultValue.constant(column.defaultValue())
+                defaultValue(column.defaultValueProvider())
         );
     }
+
+    private static DefaultValue defaultValue(DefaultValueProvider 
defaultValueProvider) {
+        if (defaultValueProvider instanceof FunctionalValueProvider) {
+            FunctionalValueProvider functionalProvider = 
(FunctionalValueProvider) defaultValueProvider;
+            return DefaultValue.functionCall(functionalProvider.name());
+        } else {
+            return DefaultValue.constant(defaultValueProvider.get());
+        }
+    }

Review Comment:
   ```suggestion
       private static DefaultValue defaultValue(DefaultValueProvider 
defaultValueProvider) {
           if (defaultValueProvider instanceof FunctionalValueProvider) {
               FunctionalValueProvider functionalProvider = 
(FunctionalValueProvider) defaultValueProvider;
               
               return DefaultValue.functionCall(functionalProvider.name());
           }
           
           return DefaultValue.constant(defaultValueProvider.get());
       }
   ```



-- 
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]

Reply via email to