title: Error while querying Data in Spark 2.2 dataframe
body: <p>i have able to query Restapi data and convert to RDD and Dataframe.
  but when i tried to query the column, instead of columnar result, i am getting comma separated value.</p>
  <p>Am i missing something?</p>
  <p>Code:</p>
  <pre><code>package Stream
  import org.apache.spark.sql._
  import org.apache.hadoop.conf.Configuration
  import org.apache.hadoop.fs._
  import org.apache.http.client.methods.HttpGet
  import org.apache.http.impl.client.DefaultHttpClient
  import org.apache.spark.sql.{DataFrame, SaveMode, SparkSession}
  import org.apache.spark.sql.functions._
  import org.apache.spark.sql.types.StructType
  import org.apache.log4j.{Level, Logger}
  import org.apache.spark.rdd.RDD
  import org.apache.spark.sql.types._
  import org.apache.spark.storage.StorageLevel
  
  object SparkRestApi {
    def main(args: Array[String]): Unit = {
  
      val logger = Logger.getLogger(&quot;blah&quot;)
      Logger.getLogger(&quot;org&quot;).setLevel(Level.WARN)
      Logger.getLogger(&quot;akka&quot;).setLevel(Level.WARN)
  
      val spark = SparkSession.builder()
        .appName(&quot;blah&quot;)
        .config(&quot;spark.driver.memory&quot;, &quot;2g&quot;)
        .master(&quot;local[*]&quot;)
        //.enableHiveSupport()
        .getOrCreate()
  
      import spark.implicits._
  
      val url = &quot;https://platform-api.opentargets.io/v3/platform/public/association/filter&quot;
      val result2 = List(scala.io.Source.fromURL(url).mkString)
      val githubRdd2=spark.sparkContext.makeRDD(result2)
      val gitHubDF2=spark.read.json(githubRdd2)
      gitHubDF2.show()
      val mediandf= gitHubDF2.select(col(&quot;data.association_score.overall&quot;).as(&quot;association_score&quot;))
      mediandf.show()
  
      spark.stop()
    }
  
  }
  </code></pre>
  <p>But Result not well formatted. It is comma separated instead of value in well formatted rows.</p>
  <pre><code>
     association_score|
  |[1.0, 1.0, 1.0, 1...|
  
  </code></pre>
  <p>But i am expecting</p>
  <pre><code>    1.0
      1.0
      1.0
  </code></pre>