I have csv data coming as DStreams from traffic counters. Sample is as follows
`Location,Vehicle,Speed,`
`tracker1,car,57,`
`tracker1,car,90,`
`tracker1,mbike,81,`
`tracker1,mbike,65,`
`tracker2,car,69,`
`tracker2,car,34,`
`tracker2,mbike,29,`
`tracker2,mbike,76,`
I want to calculate average speed (for each location) by vehicle category.
I want to achieve this by transformations. Below is the result i am looking for.
Location | Car | MBike
Tracker 1| 73.5 | 73
Tracker 2| 51.5 | 52.5
I'm not sure exactaly what you want, but if it's avarage speed by vehicle, by location, than you can use a Window function: