I have 2 dataframes:
|data |
|--------------|
|[1,Rob,12] |
|[2,Jeremy,11] |
|[3,Bart,14] |
scala> data.printSchema()
root
|-- data: array (nullable = true)
| |-- element: string (containsNull = true)
and
|headers |
|----------------|
|[id,name,deptid]|
scala> headers.printSchema()
root
|-- headers: array (nullable = true)
| |-- element: string (containsNull = true)
Question: How do I create an output data-frame with the following format using the headers DF and the data DF?
| id | name | deptid|
|----| ------|-------|
| 1 | Rob | 12 |
| 2 | Jeremy| 11 |
| 3 | Bart | 14 |