title: Pyspark adding a column of repeating values from a list
body: <p>I have a pyspark dataframe and want to add a column that adds values from a list in a repeating fashion.  If this were just python, I would probably use itertools' cycle function.  I don't know how to do this in pyspark.</p>
  <pre><code>names = ['Julia', 'Tim', 'Zoe']
  </code></pre>
  <p>My dataframe looks like this:</p>
  <pre><code>+-----+------+
  | id_A| idx_B|
  +-----+------+
  |    a|     0|       
  |    b|     0|    
  |    b|     2|       
  |    b|     2|       
  |    b|     2|       
  |    b|     2|      
  +-----+------+
  </code></pre>
  <p>I want it to look like this:</p>
  <pre><code>+-----+------+--------+
  | id_A| idx_B| names  |
  +-----+------+--------+
  |    a|     0|   Julia|
  |    b|     0|     Tim|
  |    b|     2|     Zoe|
  |    b|     2|   Julia|
  |    b|     2|     Tim|
  |    b|     2|     Zoe|
  +-----+------+--------+
  </code></pre>