title: Hive table query giving incorrect result for sum function
body: <p>Have a hive table which has data like below. </p>
  
  <pre><code>    select * from table1;
  
      id        Amount
      1         8.50
      1         -8.50
      2         3.05
  </code></pre>
  
  <p>Querying the data as below. The SUM is not returning expected output which is 0. </p>
  
  <pre><code>    select id, sum(amount) as sum from table1 group by id;
  
      id        sum
      1         -9.026113190202523E-14
      2         3.05
  </code></pre>
  
  <p>ID is of type BIGINT.
  Amount is of type: Double, Column Size: 15, Decimal Digits: 15</p>
  
  <p>Even if this is due to high precision of amount column why will it return a Non-Zero value. I checked the insert script of this table as well. The INSERT is happening with only two decimal places on the amount column. Strangely if I export the data to an excel and only if I sort data again in excel the sum appears as Zero. Without sort the sum shows a similar scientific value in excel.</p>
  
  <p>Table is on AWS HDFS and I am using Hive to connect to it.</p>