-
- Downloads
[SPARK-14415][SQL] All functions should show usages by command `DESC FUNCTION`
## What changes were proposed in this pull request? Currently, many functions do now show usages like the followings. ``` 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.] ``` This PR adds descriptions for functions and adds a testcase prevent adding function without usage. ``` 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] ``` The only exceptions are `cube`, `grouping`, `grouping_id`, `rollup`, `window`. ## How was this patch tested? Pass the Jenkins tests (including new testcases.) Author: Dongjoon Hyun <dongjoon@apache.org> Closes #12185 from dongjoon-hyun/SPARK-14415.
Showing
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Average.scala 2 additions, 0 deletions...he/spark/sql/catalyst/expressions/aggregate/Average.scala
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/CentralMomentAgg.scala 14 additions, 0 deletions...sql/catalyst/expressions/aggregate/CentralMomentAgg.scala
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Corr.scala 2 additions, 0 deletions...pache/spark/sql/catalyst/expressions/aggregate/Corr.scala
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Count.scala 6 additions, 0 deletions...ache/spark/sql/catalyst/expressions/aggregate/Count.scala
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Covariance.scala 4 additions, 0 deletions...spark/sql/catalyst/expressions/aggregate/Covariance.scala
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/First.scala 5 additions, 0 deletions...ache/spark/sql/catalyst/expressions/aggregate/First.scala
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/HyperLogLogPlusPlus.scala 5 additions, 2 deletions.../catalyst/expressions/aggregate/HyperLogLogPlusPlus.scala
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Last.scala 2 additions, 0 deletions...pache/spark/sql/catalyst/expressions/aggregate/Last.scala
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Max.scala 2 additions, 0 deletions...apache/spark/sql/catalyst/expressions/aggregate/Max.scala
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Min.scala 2 additions, 1 deletion...apache/spark/sql/catalyst/expressions/aggregate/Min.scala
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Sum.scala 2 additions, 0 deletions...apache/spark/sql/catalyst/expressions/aggregate/Sum.scala
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/arithmetic.scala 20 additions, 3 deletions...rg/apache/spark/sql/catalyst/expressions/arithmetic.scala
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/bitwiseExpressions.scala 12 additions, 0 deletions...e/spark/sql/catalyst/expressions/bitwiseExpressions.scala
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collectionOperations.scala 10 additions, 0 deletions...spark/sql/catalyst/expressions/collectionOperations.scala
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypeCreator.scala 10 additions, 0 deletions...e/spark/sql/catalyst/expressions/complexTypeCreator.scala
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/conditionalExpressions.scala 12 additions, 1 deletion...ark/sql/catalyst/expressions/conditionalExpressions.scala
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala 81 additions, 1 deletion.../spark/sql/catalyst/expressions/datetimeExpressions.scala
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/generators.scala 4 additions, 0 deletions...rg/apache/spark/sql/catalyst/expressions/generators.scala
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/jsonExpressions.scala 6 additions, 0 deletions...ache/spark/sql/catalyst/expressions/jsonExpressions.scala
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala 124 additions, 5 deletions...ache/spark/sql/catalyst/expressions/mathExpressions.scala
Loading
Please register or sign in to comment