[ https://issues.apache.org/jira/browse/CALCITE-1945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16137205#comment-16137205 ]
Julian Hyde commented on CALCITE-1945: -------------------------------------- Review comments for https://github.com/apache/calcite/pull/518/commits/d92bd5f5a73a3a355251221fedcaf95062ea447a: * When comparing enums (SqlKind in this case) try to use switch. * Consider moving SqlAvgAggFunction.AVG_AGG_FUNCTIONS into SqlKind. SqlKind already has several composites. * Instead of "if ... RexBuilder.makeAbstractCast", use RexBuilder.ensureType where possible > Allow custom return types for AVG/VARIANCE/STDDEV/COVAR > ------------------------------------------------------- > > Key: CALCITE-1945 > URL: https://issues.apache.org/jira/browse/CALCITE-1945 > Project: Calcite > Issue Type: Bug > Reporter: MinJi Kim > Assignee: Julian Hyde > > For example, return types of AVG() is the input type. So, if the input is > INT/BIGINT type, AVG() is always truncated. Depending on the database, some > database follow this behavior while others (e.g. Oracle/MySQL/etc.) do not > and return floating point values for AVG(). > Similar for other functions mentioned here. -- This message was sent by Atlassian JIRA (v6.4.14#64029)