Skip to content

Commit

Permalink
GEODE-7146: Improve Aggregate Function Docs (apache#3996)
Browse files Browse the repository at this point in the history
- Remove "no-quick-link" class from anchors.
- Corrected the return type description for SUM, COUNT and AVG.
- Re-introduced the standalone page entirely dedicated to aggregate
  functions, along with the relevant menu item.
- Documented current limitations of aggregate functions in relation
  to overflow.
  • Loading branch information
jujoramos authored Sep 19, 2019
1 parent ddd7304 commit 003b213
Show file tree
Hide file tree
Showing 6 changed files with 357 additions and 323 deletions.
3 changes: 3 additions & 0 deletions geode-book/master_middleman/source/subnavs/geode-subnav.erb
Original file line number Diff line number Diff line change
Expand Up @@ -1230,6 +1230,9 @@ limitations under the License.
<li>
<a href="/docs/guide/<%=vars.product_version_nodot%>/developing/query_select/the_select_statement.html">SELECT Statement</a>
</li>
<li>
<a href="/docs/guide/<%=vars.product_version_nodot%>/developing/query_select/aggregates.html">OQL Aggregate Functions</a>
</li>
</ul>
</li>
<li class="has_submenu">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ Before you begin, you should be familiar with [Querying](../querying_basics/chap
- DISTINCT
- Projections
- Bind parameters
- ORDER BY
- GROUP BY
- Aggregate Functions (MIN, MAX, AVG, SUM, COUNT)
- The CQ query must be created on a partitioned or replicated region. See [Region Type Restrictions for CQs](how_continuous_querying_works.html#how_continuous_querying_works__section_bfs_llr_gr).

The basic syntax for the CQ query is:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,28 @@ limitations under the License.
|------------------------|-------------|---------|
| AND | Logical operator used to create complex expressions by combining two or more expressions to produce a Boolean result. When you combine two conditional expressions using the AND operator, both conditions must evaluate to true for the entire expression to be true. | See [Operators](operators.html#operators) |
| AS | Used to provide a label for a path expression so you can refer to the path by the label later. | See [Aliases and Synonyms](../query_select/the_from_clause.html#the_from_clause__section_AB1734C16DC348479C00FD6829B933AA) |
| AVG | Returns the average arithmetic mean of the set formed by the selected expression. The type of the expression must evaluate to a `java.lang.Number`. | See [AVG](../query_select/the_select_statement.html#select_avg) |
| COUNT | Returns the quantity of values in the set formed by the selected expression. | See [COUNT](../query_select/the_select_statement.html#select_count) |
| AVG | Returns the average arithmetic mean of the set formed by the selected expression. The type of the expression must evaluate to a `java.lang.Number`. | See [AVG](../query_select/aggregates.html#avg) |
| COUNT | Returns the quantity of values in the set formed by the selected expression. | See [COUNT](../query_select/aggregates.html#count) |
| DISTINCT | Restricts the select statement to unique results (eliminates duplicates). | See [DISTINCT](../query_select/the_select_statement.html#concept_85AE7D6B1E2941ED8BD2A8310A81753E__section_972EE73A6F3E4427B6A99DB4EDF5860D) |
| ELEMENT | Query function. Extracts a single element from a collection or array. This function throws a `FunctionDomainException ` if the argument is not a collection or array with exactly one element. | See [Preset Query Functions](../query_select/the_select_statement.html#concept_85AE7D6B1E2941ED8BD2A8310A81753E__section_69DCAD624E9640028BC86FD67649DEB2) |
| FROM | You can access any object or object attribute that is available in the current scope of the query. | See [FROM Clause](../query_select/the_from_clause.html#the_from_clause) |
| GROUP BY | Allows you to summarize data, arranging or grouping results by identical field(s). | See [GROUP BY](../query_select/the_select_statement.html#select_groupBy) |
| GROUP BY | Allows you to summarize data, arranging or grouping results by identical field(s). | See [GROUP BY](../query_select/aggregates.html#groupBy) |
| &lt;HINT&gt; | Keyword that instructs the query engine to prefer certain indexes. | See [Using Query Index Hints](../query_index/query_index_hints.html) |
| IMPORT | Used to establish the name for a class in a query. | See [IMPORT Statement](../query_select/the_import_statement.html#concept_2E9F15B2FE9041238B54736103396BF7) |
| IN | The IN expression is a Boolean indicating whether one expression is present inside a collection of expressions of a compatible type. | See [IN and SET](../query_select/the_where_clause.html#the_where_clause__section_AC12146509F141378E493078540950C7) |
| IS\_DEFINED | Query function. Returns TRUE if the expression does not evaluate to [UNDEFINED](literals.html#literals__section_undefined). Inequality queries include undefined values in their query results. With the IS\_DEFINED function, you can limit results to only those elements with defined values. | See [Preset Query Functions](../query_select/the_select_statement.html#concept_85AE7D6B1E2941ED8BD2A8310A81753E__section_69DCAD624E9640028BC86FD67649DEB2) |
| IS\_UNDEFINED | Query function. Returns TRUE if the expression evaluates to [UNDEFINED](literals.html#literals__section_undefined). With the exception of inequality queries, most queries do not include undefined values in their query results. The IS\_UNDEFINED function allows undefined values to be included, so you can identify elements with undefined values. | See [Preset Query Functions](../query_select/the_select_statement.html#concept_85AE7D6B1E2941ED8BD2A8310A81753E__section_69DCAD624E9640028BC86FD67649DEB2) |
| LIMIT | Limits the number of returned results. If you use the limit keyword, you cannot also run operations on the query result set that perform any kind of summary activities. For example trying to run add or addAll or a SelectResult from a query with a LIMIT clause throws an exception. | See [LIMIT](../query_select/the_select_statement.html#concept_85AE7D6B1E2941ED8BD2A8310A81753E__section_25D7055B33EC47B19B1B70264B39212F) |
| LIKE | LIKE can be used to mean 'equals to', or if you terminate the string with a wildcard character (`%`), it behaves like 'starts with'. Note that the wildcard can only be used at the end of the comparison string. You can escape the wildcard character to represent the `%` character. You can also use the LIKE predicate if an index is present. | See [LIKE](../query_select/the_where_clause.html#the_where_clause__section_D91E0B06FFF6431490CC0BFA369425AD) |
| MIN | Returns the minimum or smallest value from the selected expression. The type of the expression must evaluate to a `java.lang.Comparable`. | See [MIN](../query_select/the_select_statement.html#select_min) |
| MAX | Returns the maximum or largest value from the selected expression. The type of the expression must evaluate to a `java.lang.Comparable`. | See [MAX](../query_select/the_select_statement.html#select_max) |
| MIN | Returns the minimum or smallest value from the selected expression. The type of the expression must evaluate to a `java.lang.Comparable`. | See [MIN](../query_select/aggregates.html#min) |
| MAX | Returns the maximum or largest value from the selected expression. The type of the expression must evaluate to a `java.lang.Comparable`. | See [MAX](../query_select/aggregates.html#max) |
| NOT | The example returns the set of portfolios that have positions. Note that NOT cannot use an index. | See [Operators](operators.html#operators) |
| NVL | Returns expr2 if expr1 is null. The expressions can be query parameters (bind arguments), path expressions, or literals. | See [Preset Query Functions](../query_select/the_select_statement.html#concept_85AE7D6B1E2941ED8BD2A8310A81753E__section_69DCAD624E9640028BC86FD67649DEB2) |
| OR | If an expression uses both AND and OR operators, the AND expression has higher precedence than OR. | See [Operators](operators.html#operators) |
| ORDER BY | Allows you to order query results (either in ascending or descending order). | See [ORDER BY](../query_select/the_select_statement.html#concept_85AE7D6B1E2941ED8BD2A8310A81753E__section_D9DF0F785CA94EF8B367C3326CC12990) |
| SELECT | Allows you to filter data from the collection of object(s) returned by a WHERE search operation. | See [SELECT Statement](../query_select/the_select_statement.html#concept_85AE7D6B1E2941ED8BD2A8310A81753E) |
| SET | Specifies a collection of values that can be compared to the returned values of query. | See [IN and SET](../query_select/the_where_clause.html#the_where_clause__section_AC12146509F141378E493078540950C7) |
| SUM | Returns the summation over the set formed by the selected expression. The type of the expression must evaluate to a `java.lang.Number`. | See [SUM](../query_select/the_select_statement.html#select_sum) |
| SUM | Returns the summation over the set formed by the selected expression. The type of the expression must evaluate to a `java.lang.Number`. | See [SUM](../query_select/aggregates.html#sum) |
| &lt;TRACE&gt; | Enables debugging on the following query string. | See [Query Debugging](query_debugging.html#concept_2D557E24AAB24044A3DB36B3124F6748) |
| TO\_DATE | Returns a Java Data class object. The arguments must be String S with date\_str representing the date and format\_str representing the format used by date\_str. The format\_str you provide is parsed using java.text.SimpleDateFormat. | See [Preset Query Functions](../query_select/the_select_statement.html#concept_85AE7D6B1E2941ED8BD2A8310A81753E__section_69DCAD624E9640028BC86FD67649DEB2) |
| TYPE | Specifying object type in the FROM clause helps the query engine to process the query at optimal speed. | See [Object Typing](../query_select/the_from_clause.html#the_from_clause__section_A5B42CCB7C924949954AEC2DAAD51134) |
Expand Down
Loading

0 comments on commit 003b213

Please sign in to comment.