[
https://issues.apache.org/jira/browse/CALCITE-4745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17400654#comment-17400654
]
Julian Hyde commented on CALCITE-4745:
--------------------------------------
This is intended behavior. If you don’t like it, you can provide your own
implementation of RelDataTypeSystem.
> RelDataTypeSystemImpl.deriveAvgAggType typing error
> ---------------------------------------------------
>
> Key: CALCITE-4745
> URL: https://issues.apache.org/jira/browse/CALCITE-4745
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.27.0
> Reporter: keaton drebes
> Priority: Minor
> Fix For: 1.27.0
>
>
> Currently, RelDataTypeSystemImpl.deriveAvgAggType returns the type of the
> input argument to the aggregation.
> This is obviously incorrect, AVG(A) where A has values [0, 1] should return
> .5, which is not an integer. This issue effects all SqlAggFunction's, since
> they ultimately use deriveAvgAggType for type inference.
> PR here: [https://github.com/apache/calcite/pull/2498]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)