We have two data frames here:
the expected dataframe:
+------+---------+--------+----------+-------+--------+ |emp_id| emp_city|emp_name| emp_phone|e
list_col=[] cols=df1.columns # Prepare list of dataframes/per column for col in cols: list_col.append(df1.select(col).subtract(df2.select(col))) # Render/persist for l in list_col : if l.count() > 0 : l.show()