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