xy720 commented on code in PR #11649:
URL: https://github.com/apache/doris/pull/11649#discussion_r942357039


##########
fe/fe-core/src/main/java/org/apache/doris/analysis/CastExpr.java:
##########
@@ -269,15 +270,28 @@ public void analyze() throws AnalysisException {
 
         // this cast may result in loss of precision, but the user requested it
         if (childType.matchesType(type)) {
-            // For types which has precision and scale, we also need to check 
quality between precisions and scales
-            if (!PrimitiveType.typeWithPrecision.contains(
-                    type.getPrimitiveType()) || ((((ScalarType) 
type).decimalPrecision()
-                    == ((ScalarType) childType).decimalPrecision()) && 
(((ScalarType) type).decimalScale()
-                    == ((ScalarType) childType).decimalScale()))) {
+            if 
(PrimitiveType.typeWithPrecision.contains(type.getPrimitiveType())) {

Review Comment:
   for example, 
   if type.isArrayType() == true, 
   but 
   ((ArrayType) type).getContainsNull() != ((ArrayType) 
childType).getContainsNull(),
   the noOp is still set to false.



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