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

Dongjoon Hyun updated SPARK-14639:
----------------------------------
    Component/s: SparkR
                 PySpark

> Add `bround` function in Python/R.
> ----------------------------------
>
>                 Key: SPARK-14639
>                 URL: https://issues.apache.org/jira/browse/SPARK-14639
>             Project: Spark
>          Issue Type: Improvement
>          Components: PySpark, SparkR
>            Reporter: Dongjoon Hyun
>
> This issue aims to expose Scala `bround` function in Python/R API.
> `bround` function is implemented in SPARK-14614 by extending current `round` 
> function.
> We used the following semantics from 
> [Hive|https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/RoundUtils.java].
> {code}
> public static double bround(double input, int scale) {
>     if (Double.isNaN(input) || Double.isInfinite(input)) {
>       return input;
>     }
>     return BigDecimal.valueOf(input).setScale(scale, 
> RoundingMode.HALF_EVEN).doubleValue();
> }
> {code}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to