title: Issue while converting string data to decimal in proper format in sparksql
body: <p>I am facing issue in <code>spark sql</code> while converting <code>string</code> to <code>decimal(15,7)</code>.</p>
  
  <p>Input data is:</p>
  
  <pre><code>'0.00'
  '28.12'
  '-39.02'
  '28.00'
  </code></pre>
  
  <p>I have tried converting it into <code>float</code> and then converting into <code>decimal</code> but got unexpected results.</p>
  
  <pre><code>sqlContext.sql("select cast(cast('0.00' as float) as decimal(15,7)) from table").show()
  </code></pre>
  
  <p>The result I received is as follows</p>
  
  <pre><code>0
  </code></pre>
  
  <p>But I need to have data in the below format:</p>
  
  <pre><code>0.0000000
  28.1200000
  -39.0200000
  28.0000000
  </code></pre>