pengxiangyu commented on a change in pull request #6768:
URL: https://github.com/apache/incubator-doris/pull/6768#discussion_r719120991



##########
File path: fe/fe-core/src/main/java/org/apache/doris/catalog/Type.java
##########
@@ -1018,6 +1018,13 @@ public static Type getCmpType(Type t1, Type t2) {
                 || (t1ResultType == PrimitiveType.VARCHAR && t2ResultType == 
PrimitiveType.STRING)) {
             return Type.STRING;
         }
+
+        // int family type and char family type should cast to char family type
+        if ((t1ResultType.isFixedPointType() && t2ResultType.isCharFamily()) ||
+                (t2ResultType.isFixedPointType() && 
t1ResultType.isCharFamily())) {
+            return t1.isStringType() ?  t1 : t2;

Review comment:
       数字类型按照字符来排序存在错误的可能。比如1235与12345,按数字递增是1235,12345,按字符串递增就是12345,1235




-- 
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: commits-unsubscr...@doris.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to