title: How to convert spark response to JSON object
body: <pre><code>val conf = new SparkConf().setAppName("test").setMaster("local")
  val sc = new SparkContext(conf)
  val sqlContext = new SQLContext(sc)
  val input = sqlContext.read.json("input.json")
  input.select("email", "first_name").where("email=='donny54@yahoo.com'").show()
  </code></pre>
  
  <p>I am getting following response</p>
  
  <p><a href="https://i.stack.imgur.com/dMrgb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dMrgb.png" alt="enter image description here"></a></p>
  
  <p>How can I get response as a JSON Object? </p>