title: Dynamically build case class or schema
body: <p>Given a list of strings, is there a way to create a case class  or a Schema without inputing the srings manually.</p>
  
  <p>For eaxample, I have a List,</p>
  
  <pre><code> val name_list=Seq("Bob", "Mike", "Tim")
  </code></pre>
  
  <p>The List will not always be the same. Sometimes it will contain different names and will vary in size.</p>
  
  <p>I can create a case class</p>
  
  <pre><code>case class names(Bob:Integer, Mike:Integer, Time:Integer)
  </code></pre>
  
  <p>or a schema</p>
  
  <pre><code> val schema = StructType(StructFiel("Bob", IntegerType,true)::
              StructFiel("Mike", IntegerType,true)::
              StructFiel("Tim", IntegerType,true)::Nil)
  </code></pre>
  
  <p>but I have to do it manually. I am looking for a method to perform this operation dynamically.</p>