Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9BD7E200C4B for ; Mon, 20 Mar 2017 14:17:45 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 9A76C160B8F; Mon, 20 Mar 2017 13:17:45 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E0EDB160B76 for ; Mon, 20 Mar 2017 14:17:44 +0100 (CET) Received: (qmail 61530 invoked by uid 500); 20 Mar 2017 13:17:44 -0000 Mailing-List: contact dev-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list dev@hive.apache.org Received: (qmail 61518 invoked by uid 99); 20 Mar 2017 13:17:43 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Mar 2017 13:17:43 +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 82D0B1814DF for ; Mon, 20 Mar 2017 13:17:43 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.651 X-Spam-Level: X-Spam-Status: No, score=0.651 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_NEUTRAL=0.652] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id kS8ono9HPv1K for ; Mon, 20 Mar 2017 13:17:42 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 7764C5FBBB for ; Mon, 20 Mar 2017 13:17:42 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id D7045E0059 for ; Mon, 20 Mar 2017 13:17:41 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 92B1B254B6 for ; Mon, 20 Mar 2017 13:17:41 +0000 (UTC) Date: Mon, 20 Mar 2017 13:17:41 +0000 (UTC) From: "Carter Shanklin (JIRA)" To: dev@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (HIVE-16255) Support percentile_cont / percentile_disc MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 20 Mar 2017 13:17:45 -0000 Carter Shanklin created HIVE-16255: -------------------------------------- Summary: Support percentile_cont / percentile_disc Key: HIVE-16255 URL: https://issues.apache.org/jira/browse/HIVE-16255 Project: Hive Issue Type: Sub-task Reporter: Carter Shanklin Way back in HIVE-259, a percentile function was added that provides a subse= t of the standard percentile_cont aggregate function. The SQL standard provides some additional options and also a percentile_dis= c aggregate function with different rules. In the standard you specify an o= rdering with arbitrary value expression and the results are drawn from this= value expression. This aggregate functions should be usable as analytic fu= nctions as well (i.e. support the over clause). The current percentile func= tion is able to be used with an over clause. The rough outline of how this works is: percentile_cont(number) within group (order by expression) [ over(window sp= ec) ] percentile_disc(number) within group (order by expression) [ over(window sp= ec) ] The value of number should be between 0 and 1. The value expression is eval= uated for each row of the group, nulls are discarded, and the remaining row= s are ordered. =E2=80=94 If PERCENTILE_CONT is specified, by considering the pair of conse= cutive rows that are indicated by the argument, treated as a fraction of th= e total number of rows in the group, and interpolating the value of the val= ue expression evaluated for these rows. =E2=80=94 If PERCENTILE_DISC is specified, by treating the group as a windo= w partition of the CUME_DIST window function, using the specified ordering = of the value expression as the window ordering, and returning the first va= lue expression whose cumulative distribution value is greater than or equal= to the argument. -- This message was sent by Atlassian JIRA (v6.3.15#6346)