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

James Taylor commented on PHOENIX-2018:
---------------------------------------

bq. What's more, I add one abstract class, JavaMathOneArgumentFunction, as base 
class for all one-argument math build-in function.
That's a good idea - that'll make it easier to implement the bulk of these.

bq. SqrtFunction is OrderPreserving.YES, so its result should be the same as 
input.
That's why I specialize the getSortOrder() method and coerce the result of 
Math.sqrt here.
You don't need to preserve the sort order if OrderPreserving is YES. Phoenix 
will still do the optimization using a reverse scan if the sort order is 
different. There's really no advantage to maintaining the sort order. We only 
do this if we can do it in-place without allocating more memory for the 
transformation (for example, with lpad and rpad).

> Implement math build-in function SQRT
> -------------------------------------
>
>                 Key: PHOENIX-2018
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2018
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: Shuxiong Ye
>            Assignee: Shuxiong Ye
>             Fix For: 5.0.0, 4.5.0, 4.4.1
>
>         Attachments: 
> 0001-PHOENIX-2018-Implement-math-build-in-function-SQRT_v3.patch, 
> 0001-PHOENIX-2018-Implement-math-build-in-function-SQRT_v4.patch
>
>
> # SQRT means square root.
> # Return type will be PDouble
> # OrderPreserving



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

Reply via email to