You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the compute sub-clause of group, make the of expression optional.
The of expression is an extractor that converts each incoming row into the argument for the aggregate function. The aggregate function is then called with those values converted into a list. For example, in
from e in emps
group compute sum of e.deptno as sumDeptno;
the sum aggregate function is called with the list [10, 20, 30, 20] formed by applying the lambda fn e => e.deptno to each row.
With this change, you would be able to omit of. The aggregate function is passed the incoming rows. For example,
from e in emps
group compute count as c
is equivalent to
from e in emps
group compute count of e as c
If there is more than one variable in the from clause (or the previous step, if it is a multi-step from) the row is a record with each variable as a field. Thus
from e in emps, d in depts
where e.deptno = d.deptno
group compute count as c
is equivalent to
from e in emps, d in depts
where e.deptno = d.deptno
group compute count of {e, d} as c
This change is basically just a short-hand. In practice, the main effect is to make count more concise, and more similar to SQL's COUNT(*).
It will also be useful for a "collect" aggregate function that builds a list of the rows in each group.
The text was updated successfully, but these errors were encountered:
In the
compute
sub-clause ofgroup
, make theof
expression optional.The
of
expression is an extractor that converts each incoming row into the argument for the aggregate function. The aggregate function is then called with those values converted into a list. For example, inthe
sum
aggregate function is called with the list[10, 20, 30, 20]
formed by applying the lambdafn e => e.deptno
to each row.With this change, you would be able to omit
of
. The aggregate function is passed the incoming rows. For example,is equivalent to
If there is more than one variable in the
from
clause (or the previous step, if it is a multi-stepfrom
) the row is a record with each variable as a field. Thusis equivalent to
This change is basically just a short-hand. In practice, the main effect is to make
count
more concise, and more similar to SQL'sCOUNT(*)
.It will also be useful for a "collect" aggregate function that builds a list of the rows in each group.
The text was updated successfully, but these errors were encountered: