I have a string like below. The first row is the header, and the rest are the column values. I want to create a dataframe (Spark 1.6 and Java7) from the String , and convert the values under col3 and col4 as DOUBLE .
col1 col2 col3 col4 col5
val1 val2 val3 val4 val5
val6 val7 val8 val9 val10
val11 val12 val13 val14 val15
After creating the dataframe for the above , i have two fields to be in the first row whose values are constants.
const1 const2 col1 col2 col3 col4 col5
const1 const2 val1 val2 val3 val4 val5
const1 const2 val6 val7 val8 val9 val10
const1 const2 val11 val12 val13 val14 val15
I want to write the above dataframe to hive table with the schema (const1 int, const2 int, col1 double, col2 double , col3 double , col4 double, col5 double). I'm using Spark 1.6 and Java7 .