title: How to convert rows into a list of dictionaries in pyspark?
body: <p>I have a DataFrame(df) in pyspark, by reading from a hive table:</p>
  
  <pre><code>df=spark.sql('select * from &lt;table_name&gt;')
  
  
  +++++++++++++++++++++++++++++++++++++++++++
  |  Name    |    URL visited               |
  +++++++++++++++++++++++++++++++++++++++++++
  |  person1 | [google,msn,yahoo]           |
  |  person2 | [fb.com,airbnb,wired.com]    |
  |  person3 | [fb.com,google.com]          |
  +++++++++++++++++++++++++++++++++++++++++++
  </code></pre>
  
  <p>When i tried the following, got an error</p>
  
  <pre><code>df_dict = dict(zip(df['name'],df['url']))
  "TypeError: zip argument #1 must support iteration."
  </code></pre>
  
  <p><code>type(df.name) is of 'pyspark.sql.column.Column'</code></p>
  
  <p>How do i create a dictionary like the following, which can be iterated later on</p>
  
  <pre><code>{'person1':'google','msn','yahoo'}
  {'person2':'fb.com','airbnb','wired.com'}
  {'person3':'fb.com','google.com'}
  </code></pre>
  
  <p>Appreciate your thoughts and help. </p>