title: Add column names to data read from csv file without column names
body: <p>I am using Apache Spark with Scala.</p>
  
  <p>I have a csv file that does not have column names in the first row. It's like this:</p>
  
  <pre><code>28,Martok,49,476
  29,Nog,48,364
  30,Keiko,50,175
  31,Miles,39,161
  </code></pre>
  
  <p>The columns represent ID, name, age, numOfFriends.</p>
  
  <p>In my Scala object, I am creating dataset using SparkSession from csv file as follows:</p>
  
  <pre><code>val spark = SparkSession.builder.master("local[*]").getOrCreate()
  val df = spark.read.option("inferSchema","true").csv("../myfile.csv")
  df.printSchema()
  </code></pre>
  
  <p>When I run the program, the result is:</p>
  
  <pre><code>|-- _c0: integer (nullable = true)
  |-- _c1: string (nullable = true)
  |-- _c2: integer (nullable = true)
  |-- _c3: integer (nullable = true)
  </code></pre>
  
  <p>How can I add names to the columns in my dataset?</p>