...
MAX
: The maximum elementMIN
: The minimum elementAVG
: The average elementSUM
: The sum of all elementsCOUNT
: The number of elementsMEDIAN
: The median elementSTDDEV
: The standard deviation- VAR: The variance
- CORR: The correlation between two attributes
- COV: The covariance between two attributes
Some nonstandard aggregations: These should only be used, if you a familiar with them:
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
output = AGGREGATE({
group_by = ['bidder'],
aggregations=[ ['MAX', 'price', 'max_price', 'double'] ]
}, input)
// Parital Aggregate example
pa = AGGREGATE({
name='PRE_AGG',
aggregations=[
['count', 'id', 'count', 'PartialAggregate'],
['sum', 'id', 'avgsum', 'PartialAggregate'],
['min', 'id', 'min', 'PartialAggregate'],
['max', 'id', 'max', 'PartialAggregate']
],
outputpa='true'
},
nexmark:person
)
out = AGGREGATE({
name='AGG',
aggregations=[
['count', 'count', 'count', 'Integer'],
['sum', 'avgsum', 'sum', 'Double'],
['avg', 'avgsum', 'avg', 'Double'],
['min', 'min', 'min', 'Integer'],
['max', 'max', 'max', 'Integer']
]
},
pa
)
/// Example for aggregations on multiple attributes
out = AGGREGATE({
aggregations=[
['corr', ['x', 'y'], 'correlation', 'Double'],
['cov', ['x', 'y'], 'covariance', 'Double']
]
},
input
) |
CQL
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
SELECT MAX(price) AS max_price FROM input GROUP BY bidder |