spark-instrumented-optimizer/sql/catalyst
Wenchen Fan 688808900d [SPARK-36926][3.2][SQL] Decimal average mistakenly overflow
backport https://github.com/apache/spark/pull/34180

### What changes were proposed in this pull request?

This bug was introduced by https://github.com/apache/spark/pull/33177

When checking overflow of the sum value in the average function, we should use the `sumDataType` instead of the input decimal type.

### Why are the changes needed?

fix a regression

### Does this PR introduce _any_ user-facing change?

Yes, the result was wrong before this PR.

### How was this patch tested?

a new test

Closes #34193 from cloud-fan/bug.

Authored-by: Wenchen Fan <wenchen@databricks.com>
Signed-off-by: Gengliang Wang <gengliang@apache.org>
2021-10-06 13:31:03 +08:00
..
benchmarks [SPARK-34950][TESTS] Update benchmark results to the ones created by GitHub Actions machines 2021-04-03 23:02:56 +03:00
src [SPARK-36926][3.2][SQL] Decimal average mistakenly overflow 2021-10-06 13:31:03 +08:00
pom.xml Preparing development version 3.2.1-SNAPSHOT 2021-09-28 10:53:42 +00:00