title: NULL when casting string values to decimal in Hive
body: <p>I'm using Hive 0.13 and I have in a STRING column of my table values like 1.250,99<br>
  I want to cast these values into decimal, so I must replace "." by "" and "," by "." The result would be 1250.99 
  This is my hql sentence:</p>
  
  <pre><code>cast(regexp_replace(regexp_replace(price, '\\.',''), ',','.') as decimal(18,6))  
  </code></pre>
  
  <p>But it returns NULL, I suppose because the conversion does not succeed. What is the problem?<br>
  If I don't do the conversion, it returns the expected string. </p>
  
  <p>UPDATE</p>
  
  <p>My problem was that there were white spaces in the column, so it could not convert it into decimal value. I have used trim function before doing the conversion.</p>