Val lines=RDD. The map (_) _2)
The map (line=& gt; {
. .
})
. ReduceByKey ((a, b)=& gt; Arjun erge (b))
.map {
Case ((IP, dateTime, query, status), stats)=& gt; {
. .
(IP, dateTime, query, count, bytes)
}
}
At this time, get a set of data (IP, dateTime, query, count, bytes),
Question: how to obtain:
1) this IP corresponding count accumulation, bytes accumulation as a result,
2) each query corresponding count accumulation, bytes accumulative results