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 91A52200BA0 for ; Fri, 30 Sep 2016 02:42:29 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9023A160AE4; Fri, 30 Sep 2016 00:42:29 +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 A46CB160AE3 for ; Fri, 30 Sep 2016 02:42:28 +0200 (CEST) Received: (qmail 83926 invoked by uid 500); 30 Sep 2016 00:42:27 -0000 Mailing-List: contact commits-help@geode.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.incubator.apache.org Delivered-To: mailing list commits@geode.incubator.apache.org Received: (qmail 83917 invoked by uid 99); 30 Sep 2016 00:42:27 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Sep 2016 00:42:27 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 5589AC1262 for ; Fri, 30 Sep 2016 00:42:27 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -6.219 X-Spam-Level: X-Spam-Status: No, score=-6.219 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id wliHVim058kF for ; Fri, 30 Sep 2016 00:42:23 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id 1F21C5FE28 for ; Fri, 30 Sep 2016 00:42:18 +0000 (UTC) Received: (qmail 79424 invoked by uid 99); 30 Sep 2016 00:42:18 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Sep 2016 00:42:18 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 18C1CEF79F; Fri, 30 Sep 2016 00:42:18 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: rvs@apache.org To: commits@geode.incubator.apache.org Date: Fri, 30 Sep 2016 00:42:59 -0000 Message-Id: <9107c297ad994259befc9a9f41e83d10@git.apache.org> In-Reply-To: <818176e5975d49669fd11f5c310aecf3@git.apache.org> References: <818176e5975d49669fd11f5c310aecf3@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [43/50] [abbrv] incubator-geode git commit: Draft of OQL aggregates documentation. [#130418485] archived-at: Fri, 30 Sep 2016 00:42:29 -0000 Draft of OQL aggregates documentation. [#130418485] - Needs revision to implement formatting/style/prose to indicate its experimental status. - Incomplete: changes not incoporporated into the grammar definition, because the grammar is not up to date. - Examples should be added (and verified) for each of the functions. Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/e1ffcd10 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/e1ffcd10 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/e1ffcd10 Branch: refs/heads/staging/docs-grant1 Commit: e1ffcd10a9d90671465a5f961d9d908fa00c9334 Parents: d12bc23 Author: Karen Miller Authored: Wed Sep 21 14:00:15 2016 -0700 Committer: Karen Miller Committed: Wed Sep 21 14:00:15 2016 -0700 ---------------------------------------------------------------------- .../the_select_statement.html.md.erb | 118 +++++++++++++++++++ ...ictions_and_unsupported_features.html.md.erb | 14 ++- 2 files changed, 130 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e1ffcd10/developing/query_select/the_select_statement.html.md.erb ---------------------------------------------------------------------- diff --git a/developing/query_select/the_select_statement.html.md.erb b/developing/query_select/the_select_statement.html.md.erb index 04d14df..04f9f3b 100644 --- a/developing/query_select/the_select_statement.html.md.erb +++ b/developing/query_select/the_select_statement.html.md.erb @@ -201,3 +201,121 @@ FROM /exampleRegion p, p.positions.values pos WHERE p.ID > 0 OR p.status = 'active' OR pos.secId OR pos.secId = 'IBM' ``` + +
+

(Experimental Feature) Aggregate Functions

+ +

+Some prose here about being experimental. +

+ +

+The aggregate functions +MIN, +MAX, +AVG, +AVG over a DISTINCT expression, +SUM over a DISTINCT expression, +COUNT, and +COUNT over a DISTINCT expression +are supported. +The GROUP BY extension is also supported where appropriate. +

+ +

+The MIN function returns the smallest of the selected +expression. +The type of the expression must evaluate to a +java.lang.Comparable. +

+ +

+The MAX function returns the largest of the selected +expression. +The type of the expression must evaluate to a +java.lang.Comparable. +

+ +

+The AVG function returns the arithmetic mean of the set +formed by the selected expression. +The type of the expression must evaluate to a +java.lang.Number. +For partitioned regions, +each node's buckets provide both a sum and the number of elements +to the node executing the query, +such that a correct average may be computed. +

+ +

+The AVG function where the DISTINCT modifier is applied +to the expression returns the arithmetic mean of the set +of unique (distinct) values. +The type of the expression must evaluate to a +java.lang.Number. +For partitioned regions, +the distinct values in a node's buckets are returned +to the node executing the query. +The query node can then calculate the avarage over +the values that are unique across nodes, +after eliminating duplicate values that come from separate nodes. +

+ +

+The SUM function returns the sum over the set +formed by the selected expression. +The type of the expression must evaluate to a +java.lang.Number. +For partitioned regions, +each node's buckets compute a sum over that node, +returning that sum +to the node executing the query, +when then sums across all nodes. +

+ +

+The SUM function where the DISTINCT modifier is applied +to the expression returns the sum over the set +of unique (distinct) values. +The type of the expression must evaluate to a +java.lang.Number. +For partitioned regions, +the distinct values in a node's buckets are returned +to the node executing the query. +The query node can then calculate the sum over +the values that are unique across nodes, +after eliminating duplicate values that come from separate nodes. +

+ +

+The COUNT function returns the quantity of values in the set +formed by the selected expression. +For example, to return the quantity of employees who have a +positive sales amount: +

+
+SELECT count(e.sales) FROM /employees e WHERE e.sales > 0.0
+
+

+The COUNT function where the DISTINCT modifier is applied +returns the quantity of unique (distinct) values in the set +formed by the selected expression. +

+
+ +
+

(Experimental Feature) GROUP BY Extension for Aggregate Functions

+ +

+GROUP BY is required +when aggregate functions are used in combination +with other selected items. +It permits ordering. +For example, +

+ +
+SELECT ID, MAX(e.sales) FROM /employees e GROUP BY ID
+
+ +
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e1ffcd10/developing/querying_basics/restrictions_and_unsupported_features.html.md.erb ---------------------------------------------------------------------- diff --git a/developing/querying_basics/restrictions_and_unsupported_features.html.md.erb b/developing/querying_basics/restrictions_and_unsupported_features.html.md.erb index 31a49b6..baac020 100644 --- a/developing/querying_basics/restrictions_and_unsupported_features.html.md.erb +++ b/developing/querying_basics/restrictions_and_unsupported_features.html.md.erb @@ -4,7 +4,6 @@ title: Query Language Restrictions and Unsupported Features At a high level, Geode does not support the following querying features: -- GROUPBY is not supported. - Indexes targeted for joins across more than one region are not supported - Static method invocations. For example, the following query is invalid: @@ -12,10 +11,21 @@ At a high level, Geode does not support the following querying features: SELECT DISTINCT * FROM /QueryRegion0 WHERE aDay = Day.Wednesday ``` -- Aggregate functions are not supported. - You cannot create an index on fields using Set/List types (Collection types) that are not comparable. The OQL index implementation expects fields to be Comparable. To workaround this, you can create a custom Collection type that implements Comparable. - ORDER BY is only supported with DISTINCT queries. In addition, there are some specific limitations on partitioned region querying. See [Partitioned Region Query Restrictions](../query_additional/partitioned_region_query_restrictions.html#concept_5353476380D44CC1A7F586E5AE1CE7E8). +
+

Features Supported on an Experimental Basis

+

+These features are supported, +but their experimental implementation may change: +

+ +
    +
  • GROUP BY +
  • The aggregate functions AVG, MIN, MAX, COUNT, SUM +
+