GitHub user dongjoon-hyun opened a pull request:
https://github.com/apache/spark/pull/12376
[SPARK-14614] Add `bround` function
## What changes were proposed in this pull request?
This PR aims to add `bound` function (aka Banker's round) by extending
current `round` implementation. [Hive supports `bround` since
1.3.0.](https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF)
**Hive (1.3 ~ 2.0)**
```
hive> select round(2.5), bround(2.5);
OK
3.0 2.0
```
**After this PR**
```scala
scala> sql("select round(2.5), bround(2.5)").head
res0: org.apache.spark.sql.Row = [3,2]
```
## How was this patch tested?
Pass the Jenkins tests (with extended tests).
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/dongjoon-hyun/spark SPARK-14614
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/12376.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #12376
----
commit 2950339c7a3cde53823f9d5fcafdbbe5b27f9549
Author: Dongjoon Hyun <[email protected]>
Date: 2016-04-13T23:08:14Z
[SPARK-14614] Add bround function
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]