title: Map in a spark dataframe
body: <p>Using Spark 2.x I'm making use of the dataframes.</p>
  
  <pre><code>val proposals = spark.read
    .option("header", true)
    .option("inferSchema", true)
    .option("delimiter", ";")
    .csv("/proposals.txt.gz")
  
  proposals.printSchema()
  </code></pre>
  
  <p>which works fine and gives:</p>
  
  <pre><code>root
   |-- MARKETCODE: string (nullable = true)
   |-- REFDATE: string (nullable = true)
   |-- UPDTIME: string (nullable = true)
   |-- UPDTIMEMSEC: integer (nullable = true)
   |-- ENDTIME: string (nullable = true)
   |-- ENDTIMEMSEC: integer (nullable = true)
   |-- BONDCODE: string (nullable = true)
  </code></pre>
  
  <p>Now I'd like to calculate a time in milliseconds and thus have written a function:</p>
  
  <pre><code>def time2usecs( time:String, msec:Int )={
      val Array(hour,minute,seconds) = time.split(":").map( _.toInt )
      msec + seconds.toInt*1000 + minute.toInt*60*1000 + hour.toInt*60*60*1000
  }
  time2usecs( "08:13:44", 111 )
  
  
  time2usecs: (time: String, msec: Int)Int
  res90: Int = 29624111
  </code></pre>
  
  <p>The last peace of the puzzle that would be something like:</p>
  
  <pre><code>proposals.withColumn( "utime",
    proposals.select("UPDTIME","UPDTIMEMSEC")
      .map( (t,tms) =&gt; time2usecs(t,tms) ))
  </code></pre>
  
  <p>But I can't figure out how to do the <code>df.select(column1, column2).map(...)</code> part.</p>