Question: Given a spark data frame with schema (user_id, salary) as below id | salary ------------ 1 | 50000 2 | 30000 3 | 25000 4
Given a spark data frame with schema (user_id, salary) as below id | salary ------------ 1 | 50000 2 | 30000 3 | 25000 4 | 70000 5 | 45000 Group by Salary bracket [0-29999, 30000-49999,50000-74999, 75000-99999, 100000+], resulting in a bracket / user_count mapping. Please show complete code including any methods/UDFs created bracket | user_count -------------------- 0-29999 | 134,245 30000-49999 | 100,245 50000-74999 | 56,451
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
