title: Converting Map type in Case Class to StructField Type
body: <p>I have a case class which I want to convert to schema in Spark</p>
  
  <pre><code>case class test(request1:Map[String, Any],response1:Option[String] = None,)
  </code></pre>
  
  <p>How do I convert this class to schema object</p>
  
  <pre><code>val mySchema = StructType(
  StructField("request1", Map[String, Any], false),StructField(" response1", Option[String],true))
  </code></pre>
  
  <p>Map and Options are not available in DataType</p>