PySpark – Select dataframe.select() only if all five mandatory columns exist
I have a dataframe in which I am only trying the parse the source files if all 5 mandatory columns(D1,D2,D3,D4,D5) exist. Currently, the problem is I am getting the attribute error when D4 or D5 does not exist. Can someone please guide me?