Level 5
August 5, 2025
Solved
expolded identityMap in one row instead of for each ids
- August 5, 2025
- 2 replies
- 2993 views
lets says idenitymap in profileSnapshot has multiple ids. example below
[uid -> "{(NULL,2910574950527,NULL)}",mid -> "{(NULL,43602939,NULL)}",gid -> "{(NULL,ef481128-3054-4846-b23c-8f7650ce025b,NULL)}",vid -> "{(NULL,cookie_id_ef481128-3054-4846-b23c-8f7650ce025b,NULL)}"]
1) now if we query the select * from profileSnapshot we get one each row per profile having its own complete indeityMap.
see the output in the attachment
2) when we use select explode(idenitymap), * from profileSnapshot it would create 4 rows , one for each identity inside the idenitymap
see the output in the attachment
3) how do i write a query where each seperate row for the same profile returned as single row instead of multiple row ?
see the expected output in the attachment