title: Dataset encoder for scala collections
body: <p>I get exception when trying to read dataset from s3. Company case class contains set with Employee case classe. </p>
  
  <pre><code>Exception in thread "main" java.lang.UnsupportedOperationException: No Encoder found for Set[com.model.company.common.Employee]
  - field (class: "scala.collection.immutable.Set", name: "employees")
  - field (class: "com.model.company.Company", name: "company")
  </code></pre>
  
  <p>I tried with kryo:</p>
  
  <blockquote>
  <pre><code>implicit def myDataEncoder[T]: Encoder[Set[Employee]] = Encoders.kryo[scala.collection.immutable.Set[Employee]
  </code></pre>
  </blockquote>
  
  <p>but it also doesn't work.
  Do you know how to convert scala collection to dataset ? </p>
  
  <p>Code:</p>
  
  <blockquote>
  <pre><code>val sqlContext = sparkSession.sqlContext
  import sqlContext.implicits._
  
  val records = sparkSession.read.json(s"s3a://${config.input.fullPath}").as[Company]
  </code></pre>
  </blockquote>