This is a dedicated watch page for a single video.
A data engineer is tasked with calculating both the total and average salary of employees, grouped by their department. They use PySpark’s groupBy and wish to apply multiple aggregations to each group. Complete the following code snippet: result_df = df . groupBy ( "department" ). ____________ ( sum ( "salary" ). alias ( "total_salary" ), avg ( "salary" ). alias ( "average_salary" ) ) What function should be used to complete the code?