I have existing dataframe as:
Timestamp, ID, Value
29/08/2017 4:51:23, ID-1, 1.1
29/08/2017 4:52:14, ID-2, 2.1
29/08/2017 4:52:14, ID-3, 3.1
29/08/2017 4:55:23, ID-1, 1.2
29/08/2017 4:55:23, ID-3, 3.2
29/08/2017 4:57:42, ID-2, 2.2
I would like to create a dataframe from existing dataframe such that 'IDs' will become column names and 'Values' will become the data of respective columns as:
Timestamp, ID-1, ID-2, ID-3
29/08/2017 4:51:23, 1.1, null, null
29/08/2017 4:52:14, null, 2.1, 3.1
29/08/2017 4:55:23, 1.2, null, 3.2
29/08/2017 4:57:42, null, 2.2, null
I am not able to figure out feasible solution for this in Scala. Help is appreciated. Thanks in advance.