[jira] [Updated] (SPARK-14639) Add `bround` function in Python/R.

2016-04-19 Thread Davies Liu (JIRA)

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

Davies Liu updated SPARK-14639:
---
Assignee: Dongjoon Hyun

> 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
>Assignee: Dongjoon Hyun
> Fix For: 2.0.0
>
>
> 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



[jira] [Updated] (SPARK-14639) Add `bround` function in Python/R.

2016-04-19 Thread Dongjoon Hyun (JIRA)

 [ 
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



[jira] [Updated] (SPARK-14639) Add `bround` function in Python/R.

2016-04-14 Thread Dongjoon Hyun (JIRA)

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

Dongjoon Hyun updated SPARK-14639:
--
Description: 
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].

```
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();
}
```

  was:For `bround` function, please refer SPARK-14614.


> Add `bround` function in Python/R.
> --
>
> Key: SPARK-14639
> URL: https://issues.apache.org/jira/browse/SPARK-14639
> Project: Spark
>  Issue Type: Improvement
>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].
> ```
> 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();
> }
> ```



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



[jira] [Updated] (SPARK-14639) Add `bround` function in Python/R.

2016-04-14 Thread Dongjoon Hyun (JIRA)

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

Dongjoon Hyun updated SPARK-14639:
--
Description: 
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}

  was:
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].

```
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();
}
```


> Add `bround` function in Python/R.
> --
>
> Key: SPARK-14639
> URL: https://issues.apache.org/jira/browse/SPARK-14639
> Project: Spark
>  Issue Type: Improvement
>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