[ 
https://issues.apache.org/jira/browse/CALCITE-1945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16128197#comment-16128197
 ] 

MinJi Kim commented on CALCITE-1945:
------------------------------------

I have a first draft of this patch here.  I would like to make sure that this 
is a proper approach.  Since we always expand AVG/VAR/STDDEV functions, so I am 
adding casts before we dividing the numerator and denominator.  Let me know if 
it should be done in another way.  Thanks!

https://github.com/apache/calcite/pull/518

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

Reply via email to