val someDF = Seq(
(4623874, "user1", "success"),
(4623874, "user2","fail"),
(4623874, "user3","success"),
(1343244, "user4","fail"),
(4235252, "user5", "fail")
).toDF("primaryid", "user","status")
This is the input data frame is it possible to get the count status for each primary id other than groupby
someDF.groupBy("primaryid", "status").count.show
+-------+-------+-----+
primaryid| status|count|
+-------+-------+-----+
|4235252| fail| 1|
|1343244| fail| 1|
|4623874| fail| 1|
|4623874|success| 2|
+-------+-------+-----+
Any other way to get the above result other than "groupby" ?