Return-Path: X-Original-To: apmail-phoenix-dev-archive@minotaur.apache.org Delivered-To: apmail-phoenix-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E2AFF186CA for ; Thu, 4 Jun 2015 07:00:51 +0000 (UTC) Received: (qmail 53441 invoked by uid 500); 4 Jun 2015 07:00:51 -0000 Delivered-To: apmail-phoenix-dev-archive@phoenix.apache.org Received: (qmail 53384 invoked by uid 500); 4 Jun 2015 07:00:51 -0000 Mailing-List: contact dev-help@phoenix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.apache.org Delivered-To: mailing list dev@phoenix.apache.org Received: (qmail 53373 invoked by uid 99); 4 Jun 2015 07:00:51 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Jun 2015 07:00:51 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 52936181A44 for ; Thu, 4 Jun 2015 07:00:51 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.97 X-Spam-Level: X-Spam-Status: No, score=0.97 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id j30YNdD53PI4 for ; Thu, 4 Jun 2015 07:00:50 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with SMTP id 5F46F428ED for ; Thu, 4 Jun 2015 07:00:50 +0000 (UTC) Received: (qmail 53358 invoked by uid 99); 4 Jun 2015 07:00:49 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Jun 2015 07:00:49 +0000 Date: Thu, 4 Jun 2015 07:00:49 +0000 (UTC) From: "James Taylor (JIRA)" To: dev@phoenix.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (PHOENIX-2018) Implement math build-in function SQRT MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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)