title: How to specify schema for CSV file without using Scala case class?
body: <p>I am loading a CSV file into a DataFrame as below.</p>
  
  <pre><code>val conf=new SparkConf().setAppName("dataframes").setMaster("local")
  val sc=new SparkContext(conf)
  val spark=SparkSession.builder().getOrCreate()
  import spark.implicits._
  
  val df = spark.
    read.  
    format("org.apache.spark.csv").
    option("header", true).
    csv("/home/cloudera/Book1.csv")
  scala&gt; df.printSchema()
  root
   |-- name: string (nullable = true)
   |-- address: string (nullable = true)
   |-- age: string (nullable = true)
  </code></pre>
  
  <p>How to change <code>age</code> column to be of type <code>Int</code>?</p>