korlov42 commented on code in PR #5538:
URL: https://github.com/apache/ignite-3/pull/5538#discussion_r2028297960


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/util/TypeUtils.java:
##########
@@ -272,14 +272,73 @@ private static boolean hasConvertableFields(RelDataType 
resultType) {
             var nativeTypeSpec = NativeTypeSpec.fromClass((Class<?>) 
storageType);
             assert nativeTypeSpec != null : "No native type spec for type: " + 
storageType;
 
-            var customType = 
SafeCustomTypeInternalConversion.INSTANCE.tryConvertToInternal(val, 
nativeTypeSpec);
-            return customType != null ? customType : val;
+            return 
SafeCustomTypeInternalConversion.INSTANCE.tryConvertToInternal(val, 
nativeTypeSpec);
         }
     }
 
     /**
-     * FromInternal.
-     * TODO Documentation https://issues.apache.org/jira/browse/IGNITE-15859
+     * Converts the given value to its presentation used by the execution 
engine.
+     */
+    public static Object toInternal(Object val, NativeTypeSpec spec) {
+        switch (spec) {
+            case INT8:
+                return SqlFunctions.toByte(val);

Review Comment:
   although this is correct, it's too expensive. Currently internal format and 
external format for all numerics as well as for `VARCHAR`, `BOOLEAN`, and 
`UUID` are the same, therefore it would be better to simply return `val` as is. 



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