Scala goupBy and merge Java : I have the following spark dataframe that I am manipulating on a databricks notebook
let's call the dataframe df.

    src	tgt
    1	2
    1	3
    1	4
    2	1
    2	3
    2	5
    3	4
    4	2
    4	5
    4	6
    5	2

I need to take the data and count the number of outgoing edges from src to 
target and from target to src. As follows.

    node	out_deg	in-deg	total_deg
    1	3	1	4
    2	3	3	6
    3	1	2	3
    4	3	2	5
    5	1	2	3
    6	0	1	1


For example: node 4 has 3 edges going out (to 2, 5, and 6) and 2 edges coming in (from 1 and 3).
It's total edges = in + out = 3 + 2 = 5.

How do I do this?
