title: How to convert Row of a Scala DataFrame into case class most efficiently?
body: <p>Once I have got in Spark some Row class, either Dataframe or Catalyst, I want to convert it to a case class in my code. This can be done by matching</p>
  
  <pre><code>someRow match {case Row(a:Long,b:String,c:Double) =&gt; myCaseClass(a,b,c)}
  </code></pre>
  
  <p>But it becomes ugly when the row has a huge number of columns, say a dozen of Doubles, some Booleans and even the occasional null. </p>
  
  <p>I would like just to be able to -sorry- cast Row to myCaseClass. Is it possible, or have I already got the most economical syntax?</p>