hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Pivovarov (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-11103) Add banker's rounding BROUND UDF
Date Mon, 29 Jun 2015 05:41:04 GMT

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

Alexander Pivovarov commented on HIVE-11103:
--------------------------------------------

2 errors are unrelated to the patch.
[~jdere] could you look at this new UDF?
This UDF is useful for financial/accounting SQL projects.
People keep asking about it, e.g.
http://www.databasejournal.com/features/mysql/rounding-down-bankers-rounding-and-random-rounding-in-mysql.html
http://www.sqlservercentral.com/Forums/Topic246556-8-1.aspx

> Add banker's rounding BROUND UDF
> --------------------------------
>
>                 Key: HIVE-11103
>                 URL: https://issues.apache.org/jira/browse/HIVE-11103
>             Project: Hive
>          Issue Type: New Feature
>          Components: UDF
>            Reporter: Alexander Pivovarov
>            Assignee: Alexander Pivovarov
>         Attachments: HIVE-11103.1.patch, HIVE-11103.1.patch
>
>
> Banker's rounding: the value is rounded to the nearest even number. Also known as "Gaussian
rounding", and, in German, "mathematische Rundung".
> Example
> {code}
>                   2 digits                2 digits
> Unrounded    "Standard" rounding    "Gaussian" rounding
>   54.1754      54.18                  54.18
>  343.2050     343.21                 343.20
> +106.2038    +106.20                +106.20 
> =========    =======                =======
>  503.5842     503.59                 503.58
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message