Hello, i'm currently using CDH 5.2
I've a sample data like this :
but when i'm upload to hive with float type, i got this :
I don't understand why 18.6 become 18.6000003815 , but 86.5 is still the same, every other variable is change except the .0 and .5 varible.
Can someone explain to me, really appreciate the help, thanks !
This behavior is like any system with float representation, float bit representation does not allow exact representation of most values. There is a lot of literature on the subject like http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html
If you want exact values it's better to go with decimal, where you can specify scale and precision.
View solution in original post