title: create substring column in spark dataframe
body: <p>I want to take a json file and map it so that one of the columns is a substring of another. For example to take the left table and produce the right table:</p>
  
  <pre><code> ------------              ------------------------
  |     a      |             |      a     |    b    |
  |------------|       -&gt;    |------------|---------|
  |hello, world|             |hello, world|  hello  |
  </code></pre>
  
  <p>I can do this using spark-sql syntax but how can it be done using the in-built functions? </p>