How to work with DataSet in Spark using scala?
<p>I load my CSV using DataFrame then I converted to DataSet but it's shows like this</p>

<p>Multiple markers at this line:<br>
    - Unable to find encoder for type stored in a Dataset. Primitive types (Int, String, etc) and Product types (case classes) are supported by importing<br>
     spark.implicits._ Support for serializing other types will be added in future releases.<br>
    - not enough arguments for method as: (implicit evidence$2:<br>
    org.apache.spark.sql.Encoder[DataSet.spark.aacsv])org.apache.spark.sql.Dataset[DataSet.spark.aacsv]. Unspecified value parameter evidence$2</p>

<p>How to resolve this?.
My code is - </p>

<pre><code>case class aaCSV(
    a: String, 
    b: String 
    )

object WorkShop {

  def main(args: Array[String]) = {
    val conf = new SparkConf()
      .setAppName("readCSV")
      .setMaster("local")
    val sc = new SparkContext(conf)
    val sqlContext = new SQLContext(sc)
    val customSchema = StructType(Array(
        StructField("a", StringType, true),
        StructField("b", StringType, true)))

    val df = sqlContext.read.format("com.databricks.spark.csv").option("header", "true").schema(customSchema).load("/xx/vv/ss.csv") 
    df.printSchema()
    df.show()
    val googleDS = df.as[aaCSV]
    googleDS.show()

  }

}
</code></pre>

<p>Now I changed main function like this - </p>

<pre><code>def main(args: Array[String]) = {
    val conf = new SparkConf()
      .setAppName("readCSV")
      .setMaster("local")
    val sc = new SparkContext(conf)
    val sqlContext = new SQLContext(sc)
import sqlContext.implicits._;
   val sa = sqlContext.read.csv("/xx/vv/ss.csv").as[aaCSV]
    sa.printSchema()
    sa.show()
}
</code></pre>

<p>But it throws error - <strong>Exception in thread "main" org.apache.spark.sql.AnalysisException: cannot resolve '<code>Adj_Close</code>' given input columns: [_c1, _c2, _c5, _c4, _c6, _c3, _c0]; line 1 pos 7</strong>. What should i do ?</p>

<p>Now I execute my method using based on given time interval using spark scheduler. But I refer this link - <a href="https://spark.apache.org/docs/latest/job-scheduling.html#scheduling-within-an-application" rel="nofollow">https://spark.apache.org/docs/latest/job-scheduling.html#scheduling-within-an-application</a>. Kindly help us.</p>