In pandas you can rename all columns in one go in a "inplace" manner using
new_column_name_list =['Pre_'+x for x in df.columns]
df.columns = new_column_name_list
Can we do the above same step in Pyspark without having to finally create new dataframe? It is inefficient because we will have 2 dataframe with the same data but different column names leading to bad memory utlilization.
The below link answers the question but its not inplace.
How to change dataframe column names in pyspark? EDIT My question is clearly different from the question in above link