Spark convert half of row data into next row
I have a csv file where each line has even number of words separated by comma. I want to read the csv file and put half data from each row to next row using spark.
Example
Input
a,b,c,d,e,f,g,h
1,2,3,4,5,6,7,8
Output
a,b,c,d
e,f,g,h
1,2,3,4
5,6,7,8
One solution is select four column and union with next four select columns. But dont want to use this approach.
