我在计算每个区域的用户时遇到问题,每个用户都会将他们的语言环境发送到服务器。有人可以帮助我实现这一目标,谢谢。输出流分析应该是这样的:
{
"sessionId": "sessionId1", -->group by sessionId
"data": {
"North America": 0,
"South America": 0,
"Europe": 0,
"Russia": 1,
"Africa": 2,
"India": 0,
"China": 2,
"Oceania": 0,
}
},
{
"sessionId": "sessionId2", -->group by sessionId
"data": {
"North America": 0,
"South America": 0,
"Europe": 0,
"Russia": 0,
"Africa": 1,
"India": 0,
"China": 0,
"Oceania": 0,
}
}
输入数据:
[{"sessionId":"Session1","deviceId":"deviceTest1","locale":"Russia"},{"sessionId":"Session1","deviceId":"deviceTest2","locale":"China"},{"sessionId":"Session1","deviceId":"deviceTest3","locale":"China"},{"sessionId":"Session1","deviceId":"deviceTest4","locale":"Africa"},{"sessionId":"Session1","deviceId":"deviceTest5","locale":"Africa"},{"sessionId":"Session2","deviceId":"deviceTest6","locale":"Africa"}]