You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/07/29 07:26:00 UTC

[GitHub] [incubator-doris] kangkaisen commented on a change in pull request #4199: Change type of sum, min, max function column in mv

kangkaisen commented on a change in pull request #4199:
URL: https://github.com/apache/incubator-doris/pull/4199#discussion_r461353389



##########
File path: fe/fe-core/src/main/java/org/apache/doris/analysis/CreateMaterializedViewStmt.java
##########
@@ -30,11 +34,6 @@
 import org.apache.doris.common.FeNameFormat;
 import org.apache.doris.common.UserException;
 

Review comment:
       Hi, you could update the `checkstyle.xml`.

##########
File path: fe/fe-core/src/main/java/org/apache/doris/analysis/CreateMaterializedViewStmt.java
##########
@@ -353,11 +353,21 @@ public MVColumnItem buildMVColumnItem(FunctionCallExpr functionCallExpr) throws
         Type type;
         switch (functionName.toLowerCase()) {
             case "sum":
+                mvColumnName = baseColumnName;
+                mvAggregateType = AggregateType.valueOf(functionName.toUpperCase());
+                PrimitiveType baseColumnType = baseColumnRef.getType().getPrimitiveType();
+                if (baseColumnType == PrimitiveType.TINYINT || baseColumnType == PrimitiveType.SMALLINT
+                        || baseColumnType == PrimitiveType.INT) {
+                    type = Type.BIGINT;
+                } else {
+                    type = Type.fromPrimitiveType(baseColumnRef.getType().getPrimitiveType());

Review comment:
       Sum float result type should be 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.

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



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