yaooqinn commented on code in PR #56078:
URL: https://github.com/apache/spark/pull/56078#discussion_r3294886796
##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/DecimalAggregatesSuite.scala:
##########
@@ -613,4 +613,92 @@ class DecimalAggregatesSuite extends PlanTest with
ScalaCheckDrivenPropertyCheck
s"evalMode should be preserved as TRY after rewrite, got " +
avgs.map(_.evalMode).mkString(","))
}
+
+ //
---------------------------------------------------------------------------
+ // SPARK-57023: DecimalAggregates widened-Cast peel for MIN/MAX. Same scale
+ // (s == sPrime) + same-or-larger precision (pPrime >= p) widening Cast is
+ // bit-identical to applying the Cast after the aggregate, because Min/Max
+ // pick an existing row's value (no arithmetic). The peel hoists the Cast
+ // out and runs Min/Max on the narrower inner Decimal.
+ //
+ // Vanilla 5.0.0-SNAPSHOT ground-truth (rule OFF vs ON) and design rationale:
+ // features/spark-decimal-minmax-cast-peel/docs/0002-decision-design.md
(rev 3)
+ //
---------------------------------------------------------------------------
+
Review Comment:
```suggestion
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]