aboutsummaryrefslogtreecommitdiff
path: root/sql/core/src/main
diff options
context:
space:
mode:
authorRoxanne Moslehi <rmoslehi@palantir.com>2017-03-25 00:10:30 +0100
committerReynold Xin <rxin@databricks.com>2017-03-25 00:10:30 +0100
commitf88f56b835b3a61ff2d59236e7fa05eda5aefcaa (patch)
tree59643482e62a05377d377b070804661e1694d4e5 /sql/core/src/main
parente011004bedca47be998a0c14fe22a6f9bb5090cd (diff)
downloadspark-f88f56b835b3a61ff2d59236e7fa05eda5aefcaa.tar.gz
spark-f88f56b835b3a61ff2d59236e7fa05eda5aefcaa.tar.bz2
spark-f88f56b835b3a61ff2d59236e7fa05eda5aefcaa.zip
[DOCS] Clarify round mode for format_number & round functions
## What changes were proposed in this pull request? Updated the description for the `format_number` description to indicate that it uses `HALF_EVEN` rounding. Updated the description for the `round` description to indicate that it uses `HALF_UP` rounding. ## How was this patch tested? Just changing the two function comments so no testing involved. Please review http://spark.apache.org/contributing.html before opening a pull request. Author: Roxanne Moslehi <rmoslehi@palantir.com> Author: roxannemoslehi <rmoslehi@berkeley.edu> Closes #17399 from roxannemoslehi/patch-1.
Diffstat (limited to 'sql/core/src/main')
-rw-r--r--sql/core/src/main/scala/org/apache/spark/sql/functions.scala10
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/functions.scala b/sql/core/src/main/scala/org/apache/spark/sql/functions.scala
index 66bb8816a6..acdb8e2d3e 100644
--- a/sql/core/src/main/scala/org/apache/spark/sql/functions.scala
+++ b/sql/core/src/main/scala/org/apache/spark/sql/functions.scala
@@ -1861,7 +1861,7 @@ object functions {
def rint(columnName: String): Column = rint(Column(columnName))
/**
- * Returns the value of the column `e` rounded to 0 decimal places.
+ * Returns the value of the column `e` rounded to 0 decimal places with HALF_UP round mode.
*
* @group math_funcs
* @since 1.5.0
@@ -1869,8 +1869,8 @@ object functions {
def round(e: Column): Column = round(e, 0)
/**
- * Round the value of `e` to `scale` decimal places if `scale` is greater than or equal to 0
- * or at integral part when `scale` is less than 0.
+ * Round the value of `e` to `scale` decimal places with HALF_UP round mode
+ * if `scale` is greater than or equal to 0 or at integral part when `scale` is less than 0.
*
* @group math_funcs
* @since 1.5.0
@@ -2191,8 +2191,8 @@ object functions {
}
/**
- * Formats numeric column x to a format like '#,###,###.##', rounded to d decimal places,
- * and returns the result as a string column.
+ * Formats numeric column x to a format like '#,###,###.##', rounded to d decimal places
+ * with HALF_EVEN round mode, and returns the result as a string column.
*
* If d is 0, the result has no decimal point or fractional part.
* If d is less than 0, the result will be null.