title: How do implicit work in Spark/Scala
body: <p>Here is a sample Spark code, which converts the <code>Seq</code> to the <code>Dataset</code>:</p>
  
  <pre><code>import spark.implicits._
  val s = Seq(1, 2, 3, 4)
  val ds = s.toDS()
  </code></pre>
  
  <p>The Scala <code>Seq</code> does not have the <code>toDS</code> method, it comes from Spark implicits. How is the Dataset created here?</p>
  
  <p>Edit: I did look at other SO answers but could not see an example, which would explain how the implicit could be used in <code>s.toDS</code>. I've referenced to the sample answer in the comment.</p>