I have a column in dataframe which has string values like
"Hardware part not present"
"Software part not present"
null
null
I want to split wrt " " and take only first 2 strings to new column and if it is null then even new column value should be null as well. how to achieve this?
result needed
column New column
Hardware part not present Hardware part
Software part not present Software part
null null
null null
how to achieve this using pyspark or python