val q =
from(t1s,t2s)((t1,t2) =>
where(
t1.id === t2.t1Id)
groupBy(
t1.name,
t1.id, t2.t1Id)
compute(count)
orderBy(count)
)
The type of the query is : GroupWithMeasures[Product3[String,Long,Long],Long]
for(z <- q) {
the GroupWithMeasure is composed of :
z.key._1 //name
z.key._2 //
t1.id
z.key._3 // t2.t1Id
z.measures // the count(*)
}
the "key" is a tuple (ProductN) that holds the N expressions of the groupBy
and the measures holds the M agregate expressions of the compute function.
The exception is when N or M == 1, the value is placed directly instead of
being a Product1.
So you have :
GroupWithMeasures[Product3[String,Long,Long],Long]
instead of :
GroupWithMeasures[Product3[String,Long,Long],Product1[Long]]
ML