You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Xuefu Zhang (JIRA)" <ji...@apache.org> on 2013/12/10 04:51:09 UTC

[jira] [Updated] (HIVE-5992) Hive inconsistently converts timestamp in AVG and SUM UDAF's

     [ https://issues.apache.org/jira/browse/HIVE-5992?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xuefu Zhang updated HIVE-5992:
------------------------------

    Component/s: UDF

> Hive inconsistently converts timestamp in AVG and SUM UDAF's
> ------------------------------------------------------------
>
>                 Key: HIVE-5992
>                 URL: https://issues.apache.org/jira/browse/HIVE-5992
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>    Affects Versions: 0.12.0
>            Reporter: Xuefu Zhang
>            Assignee: Xuefu Zhang
>
> {code}
> hive> select t, sum(t), count(*), sum(t)/count(*), avg(t) from ts group by t;
> ...
> OK
> 1977-03-15 12:34:22.345678	 227306062  1  227306062	2.27306062345678E8
> {code}
> As it can be seen, timestamp value (1977-03-15 12:34:22.345678) is converted with fractional part ignored in sum, while preserved in avg. As a further result, sum()/count() is not equivalent to avg.



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)