title: Hive parse string to columns
body: <p>In a Hive table, I have columns (all have string datatype)</p>
  
  <p>CustomerId, Name, Gender </p>
  
  <p>Name datatype is string of format </p>
  
  <pre><code>{'firstname': 'XXXXXX', 'middlename': 'YYYYYY',  'lastname': 'ZZZZZZ'}
  </code></pre>
  
  <p>Also, some of the rows have missing middlename -</p>
  
  <pre><code>CustomerId, {'firstname': 'AAAAAA', 'lastname': 'BBBBB'}, Gender 
  </code></pre>
  
  <p>I wanted to create a new table and populate the below columns -</p>
  
  <pre><code>CustomerId, firstname, middlename, lastname , Gender. 
  </code></pre>
  
  <p>Middlename will be null/spaces if value not present. Could you please help? </p>