[ https://issues.apache.org/jira/browse/PHOENIX2018?page=com.atlassian.jira.plugin.system.issuetabpanels:commenttabpanel&focusedCommentId=14572284#comment14572284
]
James Taylor commented on PHOENIX2018:

bq. What's more, I add one abstract class, JavaMathOneArgumentFunction, as base class for
all oneargument math buildin 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 inplace without allocating
more memory for the transformation (for example, with lpad and rpad).
> Implement math buildin function SQRT
> 
>
> Key: PHOENIX2018
> URL: https://issues.apache.org/jira/browse/PHOENIX2018
> Project: Phoenix
> Issue Type: Subtask
> Reporter: Shuxiong Ye
> Assignee: Shuxiong Ye
> Fix For: 5.0.0, 4.5.0, 4.4.1
>
> Attachments: 0001PHOENIX2018ImplementmathbuildinfunctionSQRT_v3.patch,
0001PHOENIX2018ImplementmathbuildinfunctionSQRT_v4.patch
>
>
> # SQRT means square root.
> # Return type will be PDouble
> # OrderPreserving

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