title: SQL - How can I sum elements of an array?
body: <p>I am using SQL with pyspark and hive, and I'm new to all of it.
  I have a hive table with a column of type string, like this:</p>
  
  <pre><code>id | values
  1  | '2;4;4'
  2  |  '5;1'
  3  |  '8;0;4'
  </code></pre>
  
  <p>I want to create a query to obtain this:</p>
  
  <pre><code>id | values | sum
  1  | '2.2;4;4'  | 10.2
  2  |  '5;1.2' |  6.2
  3  |  '8;0;4' | 12
  </code></pre>
  
  <p>By using split(values, ';') I can get arrays like ['2.2','4','4'], but I still need to convert them into decimal numbers and sum them.
  Is there a not too complicated way to do this?</p>
  
  <p>Thank you so so much in advance! And happy coding to you all :)</p>