[ https://issues.apache.org/jira/browse/HIVE-22315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16948065#comment-16948065 ]
Ramesh Kumar Thangarajan commented on HIVE-22315: ------------------------------------------------- [~gopalv] I did couple of changes to the code: # The decimal64 column and the decimal64 scalar both are already scaled up by the max(scale1,scale2) (maximum of the two scales). So I changed the final equation to only multiply by 10 ^ (outputColumn's scale). – (a * 10^(outputColumn's scale)) / b. # The second we discussed P + (z - x + y) <=18 is the same as checking R <= 18. This is because we calculate R and z as below: {code:java} // Precision: P - x + y + max(6, x + Q + 1)-- R // Scale: max(6, x + Q + 1) -- Z{code} which is same as R = P + (z-x+y), Since we already check the condition R <= 18, I have not added this check. Please let me know what you think Note: Decimal64Column – a(P,x) Decimal64 Scalar – b(Q,y) OutputColumn c(R,z) Thanks! > 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)