bwzheng2010 commented on code in PR #4739:
URL: https://github.com/apache/hive/pull/4739#discussion_r1416619728


##########
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPDivide.java:
##########
@@ -115,14 +115,34 @@ protected HiveDecimalWritable evaluate(HiveDecimal left, 
HiveDecimal right) {
 
   @Override
   protected DecimalTypeInfo deriveResultDecimalTypeInfo(int prec1, int scale1, 
int prec2, int scale2) {
-    // From https://msdn.microsoft.com/en-us/library/ms190476.aspx
-    // e1 / e2
-    // Precision: p1 - s1 + s2 + max(6, s1 + p2 + 1)
-    // Scale: max(6, s1 + p2 + 1)
-    int intDig = prec1 - scale1 + scale2;
-    int scale = Math.max(6, scale1 + prec2 + 1);
-    int prec = intDig + scale;
-    return adjustPrecScale(prec, scale);
+    boolean allowLoss = SessionState.get() == null || 
SessionState.get().getConf() == null ?

Review Comment:
   thanks, fix done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to