I have a spark Dataframe containing two columns "a" and "b".
For e.g one entry of Data is:
{"firstname" : {"s":"john"},
"secondname":{"s":"cena"} }
I want to add a column by concatenating the names, so that entry is:
{"firstname" : {"s":"john"},
"secondname":{"s":"cena"},
"fullname" :
{"s" : "john cena"}
}
I have used UDF but it is an inefficient solution for large data and acts as a black box for optimizations. Is there any way by using PySpark functions or SQL queries to achieve the result.