title: PySpark - split the string column and join part of them to form new columns
body: <p>I have a dataframe with following format:</p>
  
  <pre><code>id    text
  1     Amy How are you today? Smile
  2     Sam Not very well. Sad
  </code></pre>
  
  <p>I want to generate a new frame with following format:</p>
  
  <pre><code>id    Name    Content              Expression
  1     Amy     How are you today?   Smile
  2     Sam     Not very well.       Sad
  </code></pre>
  
  <p>To do so, I plan to first split the text column:</p>
  
  <pre class="lang-py prettyprint-override"><code>cols = F.split(df['text'], ' ')
  df = df.withColumn('Name', cols.getItem(0))
  </code></pre>
  
  <p>But how do I get content and expression? Can I use <code>cols.getItem(-1)</code> to get last element of the text? And how do I join the cols[1:-1] (second element to last second element) in <code>cols</code> to form the new column <code>content</code>?</p>
  
  <hr>
  
  <p>I investigate the data actually the double quotes with the sentence are not guaranteed. The only thing can rely on it is the space split.</p>