[ 
https://issues.apache.org/jira/browse/SPARK-23329?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16354166#comment-16354166
 ] 

Mihaly Toth commented on SPARK-23329:
-------------------------------------

How about this approach?

{code:scala}
  /**
   * Computes the sine of the given column. Works same as [[java.lang.Math.sin]]
   *
   * @param  e Column of angles, in radians.
   * @return new Column comprising sine value of each `e` element.
   *
   * @group math_funcs
   * @since 1.4.0
   */
  def sin(e: Column): Column = withExpr { Sin(e.expr) }
{code}

I am in a bit of trouble with wording. The original doc stated {{Computes the 
sine of the given}} *{{value}}* which is not really the case. Even _calculating 
the sine of a Column_ is not 100% precise but I guess not misleading given the 
context and condense enough on the other hand.

The unit of measurment can be possibly moved to the param description I believe.

Another question is that the majority of the javadocs in {{functions.scala}} is 
lacking return value and parameter descriptions. Does this Jira target to fix 
all of them (there are 334 ' def ' expressions in the file) or just the 
math_funcs group or only the trigonometric out of them as the title suggests?

> Update the function descriptions with the arguments and returned values of 
> the trigonometric functions
> ------------------------------------------------------------------------------------------------------
>
>                 Key: SPARK-23329
>                 URL: https://issues.apache.org/jira/browse/SPARK-23329
>             Project: Spark
>          Issue Type: Documentation
>          Components: SQL
>    Affects Versions: 2.3.0
>            Reporter: Xiao Li
>            Priority: Minor
>              Labels: starter
>
> We need an update on the function descriptions for all the trigonometric 
> functions. For example, {{cos}}, {{sin}}, and {{cot}}. Internally, the 
> implementation is based on the java.lang.Math. We need a clear description 
> about the units of the input arguments and the returned values. 
> For example, the following descriptions are lacking such info. 
> https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala#L551-L555
> https://github.com/apache/spark/blob/d5861aba9d80ca15ad3f22793b79822e470d6913/sql/core/src/main/scala/org/apache/spark/sql/functions.scala#L1978



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to