AMashenkov commented on a change in pull request #123:
URL: https://github.com/apache/ignite-3/pull/123#discussion_r635982581



##########
File path: 
modules/schema/src/main/java/org/apache/ignite/internal/schema/Column.java
##########
@@ -132,6 +172,35 @@ public boolean nullable() {
         return name.compareTo(o.name);
     }
 
+    /**
+     * Validate the object by column's constraint.
+     */
+    public void validate(Object val) {
+        if (val == null && !nullable) {
+            throw new IllegalArgumentException("Failed to set column (null was 
passed, but column is not nullable): " +
+                "[col=" + this + ']');
+        }
+
+        NativeType objType = NativeType.fromObject(val);
+
+        if (objType != null && type.mismatch(objType)) {
+            throw new InvalidTypeException("Column's type mismatch [" +
+                "column=" + this +
+                ", expectedType=" + type +
+                ", actualType=" + objType +
+                ", val=" + val + ']');
+        }
+    }
+
+    /**
+     * Copy column with new schema index.
+     *
+     * @param schemaIndex new schema index.

Review comment:
       ```suggestion
        * @param schemaIndex Column index in the schema.
        * @return Column.
   ```




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to