Skip to content

Commit

Permalink
[SPARK-24408][SQL][DOC] Move abs, bitwiseNOT, isnan, nanvl functions …
Browse files Browse the repository at this point in the history
…to math_funcs group
  • Loading branch information
jaceklaskowski committed May 29, 2018
1 parent 23db600 commit 25fe97f
Showing 1 changed file with 36 additions and 34 deletions.
70 changes: 36 additions & 34 deletions sql/core/src/main/scala/org/apache/spark/sql/functions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1031,14 +1031,6 @@ object functions {
// Non-aggregate functions
//////////////////////////////////////////////////////////////////////////////////////////////

/**
* Computes the absolute value.
*
* @group normal_funcs
* @since 1.3.0
*/
def abs(e: Column): Column = withExpr { Abs(e.expr) }

/**
* Creates a new array column. The input columns must all have the same data type.
*
Expand Down Expand Up @@ -1107,14 +1099,6 @@ object functions {
*/
def input_file_name(): Column = withExpr { InputFileName() }

/**
* Return true iff the column is NaN.
*
* @group normal_funcs
* @since 1.6.0
*/
def isnan(e: Column): Column = withExpr { IsNaN(e.expr) }

/**
* Return true iff the column is null.
*
Expand Down Expand Up @@ -1164,16 +1148,6 @@ object functions {
*/
def monotonically_increasing_id(): Column = withExpr { MonotonicallyIncreasingID() }

/**
* Returns col1 if it is not NaN, or col2 if col1 is NaN.
*
* Both inputs should be floating point columns (DoubleType or FloatType).
*
* @group normal_funcs
* @since 1.5.0
*/
def nanvl(col1: Column, col2: Column): Column = withExpr { NaNvl(col1.expr, col2.expr) }

/**
* Unary minus, i.e. negate the expression.
* {{{
Expand Down Expand Up @@ -1324,14 +1298,6 @@ object functions {
CaseWhen(Seq((condition.expr, lit(value).expr)))
}

/**
* Computes bitwise NOT.
*
* @group normal_funcs
* @since 1.4.0
*/
def bitwiseNOT(e: Column): Column = withExpr { BitwiseNot(e.expr) }

/**
* Parses the expression string into the column that it represents, similar to
* [[Dataset#selectExpr]].
Expand All @@ -1353,6 +1319,14 @@ object functions {
// Math Functions
//////////////////////////////////////////////////////////////////////////////////////////////

/**
* Computes the absolute value of a numeric value.
*
* @group math_funcs
* @since 1.3.0
*/
def abs(e: Column): Column = withExpr { Abs(e.expr) }

/**
* @return inverse cosine of `e` in radians, as if computed by `java.lang.Math.acos`
*
Expand Down Expand Up @@ -1532,6 +1506,14 @@ object functions {
*/
def bin(columnName: String): Column = bin(Column(columnName))

/**
* Computes bitwise NOT (~) of a number.
*
* @group math_funcs
* @since 1.4.0
*/
def bitwiseNOT(e: Column): Column = withExpr { BitwiseNot(e.expr) }

/**
* Computes the cube-root of the given value.
*
Expand Down Expand Up @@ -1696,6 +1678,26 @@ object functions {
*/
def hex(column: Column): Column = withExpr { Hex(column.expr) }

/**
* Return true iff the column is NaN.
*
* Both inputs should be floating point columns (DoubleType or FloatType).
*
* @group math_funcs
* @since 1.6.0
*/
def isnan(e: Column): Column = withExpr { IsNaN(e.expr) }

/**
* Returns col1 if it is not NaN, or col2 if col1 is NaN.
*
* Both inputs should be floating point columns (DoubleType or FloatType).
*
* @group math_funcs
* @since 1.5.0
*/
def nanvl(col1: Column, col2: Column): Column = withExpr { NaNvl(col1.expr, col2.expr) }

/**
* Inverse of hex. Interprets each pair of characters as a hexadecimal number
* and converts to the byte representation of number.
Expand Down

0 comments on commit 25fe97f

Please sign in to comment.