Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/22450#discussion_r218760543
--- 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 --
ah i see. Can we add a test in `DataFrameSuite` with decimal literal?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]