csun5285 commented on code in PR #51145:
URL: https://github.com/apache/doris/pull/51145#discussion_r2115042823


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayAvg.java:
##########
@@ -96,6 +98,16 @@ public ArrayAvg(Expression arg) {
     //     return signature;
     // }
 
+    @Override
+    public void checkLegalityBeforeTypeCoercion() {
+        DataType argType = child().getDataType();
+        if (((ArrayType) argType).getItemType().isComplexType()
+                                        || ((ArrayType) 
argType).getItemType().isStringType()) {
+            throw new AnalysisException(toSql() + " does not support type: "

Review Comment:
   OK,Array_avg(array<string>) will be casted to Array_avg(array<double>)



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayAvg.java:
##########
@@ -96,6 +98,16 @@ public ArrayAvg(Expression arg) {
     //     return signature;
     // }
 
+    @Override
+    public void checkLegalityBeforeTypeCoercion() {
+        DataType argType = child().getDataType();
+        if (((ArrayType) argType).getItemType().isComplexType()
+                                        || ((ArrayType) 
argType).getItemType().isStringType()) {
+            throw new AnalysisException(toSql() + " does not support type: "

Review Comment:
   OK,`Array_avg(array<string>)` will be casted to `Array_avg(array<double>)`



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to