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


##########
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:
   maybe should convert stirng to double to ensure `arrayAvg` has the same 
behavior of `avg`



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArraySum.java:
##########
@@ -68,6 +70,16 @@ public ArraySum(Expression arg) {
         super("array_sum", arg);
     }
 
+    @Override
+    public void checkLegalityBeforeTypeCoercion() {
+        DataType argType = child().getDataType();
+        if (((ArrayType) argType).getItemType().isComplexType()
+                                        || ((ArrayType) 
argType).getItemType().isStringType()) {

Review Comment:
   same as array avg



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayProduct.java:
##########
@@ -67,6 +69,16 @@ public ArrayProduct(Expression arg) {
         super("array_product", arg);
     }
 
+    @Override
+    public void checkLegalityBeforeTypeCoercion() {
+        DataType argType = child().getDataType();

Review Comment:
   same as array_avg



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ArrayJoin.java:
##########
@@ -60,6 +62,15 @@ public ArrayJoin(Expression arg0, Expression arg1, 
Expression arg2) {
         super("array_join", arg0, arg1, arg2);
     }
 
+    @Override
+    public void checkLegalityBeforeTypeCoercion() {
+        DataType argType = child(0).getDataType();
+        if (((ArrayType) argType).getItemType().isComplexType()) {

Review Comment:
   why not support complex type?



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