[ https://issues.apache.org/jira/browse/HIVE-22315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16948225#comment-16948225 ]
Gopal Vijayaraghavan edited comment on HIVE-22315 at 10/10/19 5:50 AM: ----------------------------------------------------------------------- The math for rounding up/down works even for integer fixedpoints. I'll dig up some docs on it right now. for (12,2) and 3.95 + -728, here's the round-up/down values to turn into scale6 {code} scala> ((395 * 10000) / -728) res1: Int = -5426 {code} that with scale 6 = -0.005426 which is the same as the DecimalWritable output. However, the upscaled version doesn't {code} scala> ((395 * 1000_000) / (-728*100)) res4: Int = -5425 {code} was (Author: gopalv): The math for rounding up/down works even for integer fixedpoints. I'll dig up some docs on it right now. for (12,2) and 3.95 + -728, here's the round-up/down values to turn into scale6 {code} scala> ((395 * 10000) / -728) res1: Int = -5426 {code} that with scale 6 = -0.005426 which is the same as the DecimalWritable output. However, the upscaled version doesn't {code} scala> ((395 * 1000000) / (-728*100)) res4: Int = -5425 {code} > Support Decimal64 column division with decimal64 scalar > ------------------------------------------------------- > > Key: HIVE-22315 > URL: https://issues.apache.org/jira/browse/HIVE-22315 > Project: Hive > Issue Type: Bug > Reporter: Ramesh Kumar Thangarajan > Assignee: Ramesh Kumar Thangarajan > Priority: Major > Attachments: HIVE-22315.1.patch > > > Currently division operation is not supported for Decimal64 column. This Jira > will take care of supporting decimal64 column division with a decimal64 > scalar. -- This message was sent by Atlassian Jira (v8.3.4#803005)