deniskuzZ commented on code in PR #4739: URL: https://github.com/apache/hive/pull/4739#discussion_r1410598561
########## 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: ```` HiveConf.getBoolVar(SessionState.getSessionConf(), HiveConf.ConfVars. HIVE_SQL_DECIMAL_OPERATIONS_ALLOW_PRECISION_LOSS); ```` -- 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