title: Reading a spark data frame as an array type from Postgres DB
body: <p>I have a local PSQL database on my computer. Some columns have the data contained in them as an array. (Example below)</p>
  
  <pre><code>+--------------------+
  |            _authors|
  +--------------------+
  |[u'Miller, Roger ...|
  |[u'Noyes, H.Pierre']|
  |[u'Berman, S.M.',...|
  +--------------------+
  only showing top 3 rows
  
  root
   |-- _authors: string (nullable = true)
  </code></pre>
  
  <p>I need to read them as an Array / Wrapped array. How do i achieve that?</p>
  
  <pre><code>val sqlContext: SQLContext = new SQLContext(sc)
  val df_records = sqlContext.read.format("jdbc").option("url", "jdbc:postgresql://localhost:5432/dbname")
    .option("driver", "org.postgresql.Driver")
    .option("dbtable", "public.records")
    .option("user", "name")
    .option("password", "pwd").load().select("_authors")
  df_records.printSchema()
  </code></pre>
  
  <p>I need to explode this array / flatten in later stages of my pipeline.</p>
  
  <p>Thanks,</p>