[ https://issues.apache.org/jira/browse/HIVE-2693?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13535548#comment-13535548 ]
Gunther Hagleitner commented on HIVE-2693: ------------------------------------------ Solution Number 1 would be nice, but I don't think we'll be able to do that. Any time we convert to double in an intermediate step we lose precision - and I don't think it can be recovered by using string or anything else afterwards. That seems to be just in the nature of floating point operations. We could round to fewer digits in the conversion for instance, but that will probably just cause issues elsewhere. Not converting to double also seems a bad choice. That would change some very fundamental behavior in hive. All of a sudden "select 3.14 * 2 ..." would return BigDecimal instead of double. Not good. So, I am in favor of throwing an error. At least we'll fail early and don't send users on a wild goose chase. Although it's not ideal either: The where clause issue wouldn't have happened for instance. But we probably don't want to bar explicit casts ("cast (3.14 as decimal)") even though they probably won't do what anyone thinks they do. Or do we want to disallow them? > Add DECIMAL data type > --------------------- > > Key: HIVE-2693 > URL: https://issues.apache.org/jira/browse/HIVE-2693 > Project: Hive > Issue Type: New Feature > Components: Query Processor, Types > Affects Versions: 0.10.0 > Reporter: Carl Steinbach > Assignee: Prasad Mujumdar > Attachments: 2693_7.patch, 2693_8.patch, 2693_fix_all_tests1.patch, > HIVE-2693-10.patch, HIVE-2693-11.patch, HIVE-2693-12-SortableSerDe.patch, > HIVE-2693-13.patch, HIVE-2693-1.patch.txt, HIVE-2693-all.patch, > HIVE-2693-fix.patch, HIVE-2693.patch, HIVE-2693-take3.patch, > HIVE-2693-take4.patch > > > Add support for the DECIMAL data type. HIVE-2272 (TIMESTAMP) provides a nice > template for how to do this. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira