title: Spark Dataset API - join
body: <p>I am trying to use the Spark <a href="https://databricks.com/blog/2016/01/04/introducing-spark-datasets.html" rel="noreferrer">Dataset</a> API but I am having some issues doing a simple join.</p>
  
  <p>Let's say I have two dataset with fields: <code>date | value</code>, then in the case of <code>DataFrame</code> my join would look like:</p>
  
  <pre><code>val dfA : DataFrame
  val dfB : DataFrame
  
  dfA.join(dfB, dfB("date") === dfA("date") )
  </code></pre>
  
  <p>However for <code>Dataset</code> there is the <code>.joinWith</code> method, but the same approach does not work: </p>
  
  <pre><code>val dfA : Dataset
  val dfB : Dataset
  
  dfA.joinWith(dfB, ? )
  </code></pre>
  
  <p>What is the argument required by <code>.joinWith</code> ?</p>