title: How to compare two dataframe and print columns that are different in scala
body: <p>We have two data frames here:</p>
  
  <p>the expected dataframe:</p>
  
  <pre><code>+------+---------+--------+----------+-------+--------+
  |emp_id| emp_city|emp_name| emp_phone|emp_sal|emp_site|
  +------+---------+--------+----------+-------+--------+
  |     3|  Chennai|  rahman|9848022330|  45000|SanRamon|
  |     1|Hyderabad|     ram|9848022338|  50000|      SF|
  |     2|Hyderabad|   robin|9848022339|  40000|      LA|
  |     4|  sanjose|   romin|9848022331|  45123|SanRamon|
  +------+---------+--------+----------+-------+--------+
  </code></pre>
  
  <p>and the actual data frame:</p>
  
  <pre><code>+------+---------+--------+----------+-------+--------+
  |emp_id| emp_city|emp_name| emp_phone|emp_sal|emp_site|
  +------+---------+--------+----------+-------+--------+
  |     3|  Chennai|  rahman|9848022330|  45000|SanRamon|
  |     1|Hyderabad|     ram|9848022338|  50000|      SF|
  |     2|Hyderabad|   robin|9848022339|  40000|      LA|
  |     4|  sanjose|  romino|9848022331|  45123|SanRamon|
  +------+---------+--------+----------+-------+--------+
  </code></pre>
  
  <p>the difference between the two dataframes now is:</p>
  
  <pre><code>+------+--------+--------+----------+-------+--------+
  |emp_id|emp_city|emp_name| emp_phone|emp_sal|emp_site|
  +------+--------+--------+----------+-------+--------+
  |     4| sanjose|  romino|9848022331|  45123|SanRamon|
  +------+--------+--------+----------+-------+--------+
  </code></pre>
  
  <p>We are using the except function df1.except(df2), however the problem with this is, it returns the entire rows that are different. What we want is to see which columns are different within that row (in this case, "romin" and "romino" from "emp_name" are different). We have been having tremendous difficulty with it and any help would be great.</p>