Skip to content

Commit 644684d

Browse files
robot-pigletblinkov
authored andcommitted
Intermediate changes
commit_hash:17a903d36007950139a4f3a7676d0c6190090981
1 parent dcdc4ec commit 644684d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+733
-733
lines changed

yql/essentials/docs/en/builtins/aggregation.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Counting the number of rows in the table (if `*` or constant is specified as the
66

77
Like other aggregate functions, it can be combined with [GROUP BY](../syntax/group_by.md) to get statistics on the parts of the table that correspond to the values in the columns being grouped. Use the modifier [DISTINCT](../syntax/group_by.md#distinct) to count distinct values.
88

9-
### Examples
9+
#### Examples
1010

1111
```yql
1212
SELECT COUNT(*) FROM my_table;
@@ -26,7 +26,7 @@ Minimum or maximum value.
2626

2727
As an argument, you may use an arbitrary computable expression with a numeric result.
2828

29-
### Examples
29+
#### Examples
3030

3131
```yql
3232
SELECT MIN(value), MAX(value) FROM my_table;
@@ -52,7 +52,7 @@ As an argument, you may use an arbitrary computable expression with a numeric re
5252

5353
Integer values and time intervals are automatically converted to Double.
5454

55-
### Examples
55+
#### Examples
5656

5757
```yql
5858
SELECT AVG(value) FROM my_table;
@@ -66,7 +66,7 @@ The value `NULL` is equated to `false` (if the argument type is `Bool?`).
6666

6767
The function *does not* do the implicit type casting to Boolean for strings and numbers.
6868

69-
### Examples
69+
#### Examples
7070

7171
```yql
7272
SELECT
@@ -85,7 +85,7 @@ Sum or arithmetic average, but only for the rows that satisfy the condition pass
8585

8686
Therefore, `SUM_IF(value, condition)` is a slightly shorter notation for `SUM(IF(condition, value))`, same for `AVG`. The argument's data type expansion is similar to the same-name functions without a suffix.
8787

88-
### Examples
88+
#### Examples
8989

9090
```yql
9191
SELECT
@@ -112,7 +112,7 @@ Get the value for an expression specified as an argument, for one of the table r
112112

113113
Because of no guarantee, `SOME` is computationally cheaper than [MIN / MAX](#min-max) often used in similar situations.
114114

115-
### Examples
115+
#### Examples
116116

117117
```yql
118118
SELECT
@@ -141,7 +141,7 @@ By selecting accuracy, you can trade added resource and RAM consumption for decr
141141

142142
All the three functions are aliases at the moment, but `CountDistinctEstimate` may start using a different algorithm in the future.
143143

144-
### Examples
144+
#### Examples
145145

146146
```yql
147147
SELECT
@@ -169,7 +169,7 @@ To return a list of multiple values from one line, **DO NOT** use the `AGGREGATE
169169

170170
For example, you can combine it with `DISTINCT` and the function [String::JoinFromList](../udf/list/string.md) (it's an equivalent of `','.join(list)` in Python) to output to a string all the values found in the column after [GROUP BY](../syntax/group_by.md).
171171

172-
### Examples
172+
#### Examples
173173

174174
```yql
175175
SELECT
@@ -219,7 +219,7 @@ If the second argument is always `NULL`, the aggregation result is `NULL`.
219219

220220
When you use [aggregation factories](basic.md#aggregationfactory), a `Tuple` containing a value and a key is passed as the first [AGGREGATE_BY](#aggregate-by) argument.
221221

222-
### Examples
222+
#### Examples
223223

224224
```yql
225225
SELECT
@@ -244,7 +244,7 @@ FROM my_table;
244244

245245
Return a list of the maximum/minimum values of an expression. The first argument is an expression, the second argument limits the number of items.
246246

247-
### Examples
247+
#### Examples
248248

249249
```yql
250250
SELECT
@@ -269,7 +269,7 @@ Return a list of values of the first argument for the rows containing the maximu
269269

270270
When you use [aggregation factories](basic.md#aggregationfactory), a `Tuple` containing a value and a key is passed as the first [AGGREGATE_BY](#aggregate-by) argument. In this case, the limit for the number of items is passed by the second argument at factory creation.
271271

272-
### Examples
272+
#### Examples
273273

274274
```yql
275275
SELECT
@@ -304,7 +304,7 @@ Optional arguments:
304304
1. For `TOPFREQ`, the desired number of items in the result. `MODE` is an alias to `TOPFREQ` with this argument set to 1. For `TOPFREQ`, this argument is also 1 by default.
305305
2. The number of items in the buffer used: lets you trade memory consumption for accuracy. Default: 100.
306306

307-
### Examples
307+
#### Examples
308308

309309
```yql
310310
SELECT
@@ -328,7 +328,7 @@ Several abbreviated aliases are also defined, for example, `VARPOP` or `STDDEVSA
328328

329329
If all the values passed are `NULL`, it returns `NULL`.
330330

331-
### Examples
331+
#### Examples
332332

333333
```yql
334334
SELECT
@@ -349,7 +349,7 @@ Unlike most other aggregate functions, they don't skip `NULL`, but accept it as
349349

350350
When you use [aggregation factories](basic.md#aggregationfactory), a `Tuple` containing two values is passed as the first [AGGREGATE_BY](#aggregate-by) argument.
351351

352-
### Examples
352+
#### Examples
353353

354354
```yql
355355
SELECT
@@ -458,7 +458,7 @@ While FastGreedyShrink is used most of the time, SlowShrink is mostly used for h
458458
459459
When you use [aggregation factories](basic.md#aggregationfactory), a `Tuple` containing a value and a weight is passed as the first [AGGREGATE_BY](#aggregate-by) argument.
460460
461-
### Examples
461+
#### Examples
462462
463463
```yql
464464
SELECT
@@ -498,7 +498,7 @@ The format of the result is totally similar to [adaptive histograms](#histogram)
498498

499499
If the spread of input values is uncontrollably large, we recommend that you specify the minimum and maximum values to prevent potential failures due to high memory consumption.
500500

501-
### Examples
501+
#### Examples
502502

503503
```yql
504504
SELECT
@@ -510,7 +510,7 @@ FROM my_table;
510510

511511
## BOOL_AND, BOOL_OR and BOOL_XOR {#bool-and-or-xor}
512512

513-
### Signature
513+
#### Signature
514514

515515
```yql
516516
BOOL_AND(Bool?)->Bool?
@@ -543,7 +543,7 @@ Examples of such behavior can be found below.
543543

544544
To skip `NULL` values during aggregation, use the `MIN`/`MAX` or `BIT_AND`/`BIT_OR`/`BIT_XOR` functions.
545545

546-
### Examples
546+
#### Examples
547547

548548
```yql
549549
$data = [
@@ -572,7 +572,7 @@ FROM AS_TABLE($data);
572572

573573
Apply the relevant bitwise operation to all values of a numeric column or expression.
574574

575-
### Examples
575+
#### Examples
576576

577577
```yql
578578
SELECT
@@ -594,7 +594,7 @@ Applying an [aggregation factory](basic.md#aggregationfactory) to all values of
594594
1. Column, `DISTINCT` column or expression.
595595
2. Factory.
596596

597-
### Examples
597+
#### Examples
598598

599599
```yql
600600
$count_factory = AggregationFactory("COUNT");

0 commit comments

Comments
 (0)