Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/22450#discussion_r218754608
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/DecimalPrecision.scala
---
@@ -129,16 +129,17 @@ object DecimalPrecision extends TypeCoercionRule {
resultType)
case Divide(e1 @ DecimalType.Expression(p1, s1), e2 @
DecimalType.Expression(p2, s2)) =>
+ val adjP2 = if (s2 < 0) p2 - s2 else p2
--- End diff --
This rule was added long time ago, do you mean this is a long-standing bug?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]