title: Spark and Scala, add new column with value from another dataframe by mapping common key
body: <p>I have 2 dataframes.<br>
  df1 =  </p>
  
  <pre><code>dep-code    rank
      abc        1
      bcd        2
  </code></pre>
  
  <p>df2 =  </p>
  
  <pre><code>some cols...  dep-code 
                    abc
                    bcd
                    abc
  </code></pre>
  
  <p>I want to add new column to df2 as rank with df1.dep-code = df2.dep-code</p>
  
  <p>result -  </p>
  
  <pre><code>some cols...   dep-code   rank
                    abc       1
                    bcd       2
                    abc       1
  </code></pre>