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


##########
modules/schema/src/main/java/org/apache/ignite/internal/schema/Column.java:
##########
@@ -207,11 +208,18 @@ public void validate(@Nullable Object val) {
         NativeType objType = NativeTypes.fromObject(val);
 
         if (objType != null && type.mismatch(objType)) {
-            throw new InvalidTypeException("Column's type mismatch ["
-                    + "column=" + this
-                    + ", expectedType=" + type
-                    + ", actualType=" + objType
-                    + ", val=" + val + ']');
+            boolean specMatches = objType.spec() == type.spec();
+
+            if (specMatches &&  type instanceof VarlenNativeType) {
+                String error = format("Value too long for type {} in column 
'{}'", type.displayName(), name);

Review Comment:
   Fixed.



##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/client/ItThinClientMarshallingTest.java:
##########
@@ -233,13 +235,19 @@ public void testIncompatiblePojoFieldType2() {
 
     @Test
     public void testIncompatibleTupleElementType() {
-        Table table = ignite().tables().table(TABLE_NAME);
+        var tableName = "testIncompatibleTupleElementType";
+        ignite().sql().execute(null, "CREATE TABLE " + tableName + " (KEY INT 
PRIMARY KEY, VAL VARCHAR NOT NULL)");
+
+        Table table = ignite().tables().table(tableName);
         var tupleView = table.recordView();
 
-        Tuple rec = Tuple.create().set("KEY", "1").set("VAL", BigDecimal.ONE);
+        Tuple rec = Tuple.create().set("KEY", 1).set("VAL", 1L);
 
+        // The validation done on a client side (for a thin client), and 
messages may differ between embedded clients and thin clients.
+        // For an embedded client the message include type precision, but for 
a thin client it doesn't.

Review Comment:
   Done.



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