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

Nicholas Chammas commented on SPARK-3176:
-----------------------------------------

Reposting a [comment I made on the 
PR|https://github.com/apache/spark/pull/2099#discussion_r16691086] here, since 
it relates to {{POWER}}'s behavior. 

[~marmbrus] and [~xinyunh] - We should probably document that behavior in this 
JIRA issue for starters, and then also in the appropriate docs.

{quote}
Microsoft has some good documentation for how SQL Server handles these things. 
As an established and very popular product, SQL Server could provide y'all with 
a good reference implementation for this behavior.

>From their [documentation on 
>{{POWER()}}|http://msdn.microsoft.com/en-us/library/ms174276.aspx]:
> Returns the same type as submitted in _float_expression_. For example, if a 
> *decimal*(2,0) is submitted as _float_expression_, the result returned is 
> *decimal*(2,0).

There are a few good examples that follow.

Microsoft also has some good documentation on [how precision, scale, and length 
are calculated for results of arithmetic 
operations|http://msdn.microsoft.com/en-us/library/ms190476.aspx].
{quote}

> Implement 'POWER', 'ABS and 'LAST' for sql
> ------------------------------------------
>
>                 Key: SPARK-3176
>                 URL: https://issues.apache.org/jira/browse/SPARK-3176
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 1.0.2, 1.1.0
>         Environment: All
>            Reporter: Xinyun Huang
>            Priority: Minor
>             Fix For: 1.2.0
>
>   Original Estimate: 3h
>  Remaining Estimate: 3h
>
> Add support for the mathematical function "POWER" and "ABS" and  the analytic 
> function "last" to return a subset of the rows satisfying a query within 
> spark sql.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to