GitHub user dongjoon-hyun opened a pull request:
https://github.com/apache/spark/pull/12185
[SPARK-14415] Add ExpressionDescription annotation for SQL expressions
## What changes were proposed in this pull request?
For Spark SQL, this PR aims to show the following function (expression)
description properly by adding `ExpressionDescription` annotation.
**Functions**
- abs
- acos
- asin
- atan
- atan2
- ascii
- base64
- bin
- ceil
- ceiling
- concat
- concat_ws
- conv
- cos
- cosh
- decode
- degrees
- e
- encode
- exp
- expm1
- hex
- hypot
- factorial
- find_in_set
- floor
- format_number
- format_string
- instr
- length
- levenshtein
- locate
- log
- log2
- log10
- log1p
- lpad
- ltrim
- pi
- pmod
- pow
- power
- radians
- repeat
- reverse
- round
- rpad
- rtrim
- shiftleft
- shiftright
- shiftrightunsigned
- signum
- sin
- sinh
- soundex
- sqrt
- substr
- substring
- substring_index
- tan
- tanh
- translate
- trim
- unbase64
- unhex
**Before**
```
scala> sql("desc function extended `sin`").collect().foreach(println)
[Function: sin]
[Class: org.apache.spark.sql.catalyst.expressions.Sin]
[Usage: To be added.]
[Extended Usage:
To be added.]
```
**After**
```
scala> sql("desc function extended `sin`").collect().foreach(println);
[Function: sin]
[Class: org.apache.spark.sql.catalyst.expressions.Sin]
[Usage: sin(x) - Returns the sine of x.]
[Extended Usage:
> SELECT sin(0);
0.0]
```
## How was this patch tested?
Manual.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/dongjoon-hyun/spark SPARK-14415
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/12185.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 #12185
----
commit 1bc40e18e5ad4dfc2e45e28a9a813ee4ea21dba1
Author: Dongjoon Hyun <[email protected]>
Date: 2016-04-05T22:26:35Z
[SPARK-14415] Add ExpressionDescription annotation for SQL expressions
Files:
- mathExpressions.scala
- stringExpressions.scala
- arithmetic.scala
Functions:
abs
acos
asin
atan
atan2
ascii
base64
bin
ceil
ceiling
concat
concat_ws
conv
cos
cosh
decode
degrees
e
encode
exp
expm1
hex
hypot
factorial
find_in_set
floor
format_number
format_string
instr
length
levenshtein
locate
log
log2
log10
log1p
lpad
ltrim
pi
pmod
pow
power
radians
repeat
reverse
round
rpad
rtrim
shiftleft
shiftright
shiftrightunsigned
signum
sin
sinh
soundex
sqrt
substr
substring
substring_index
tan
tanh
translate
trim
unbase64
unhex
----
---
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]