Uh oh!
There was an error while loading. Please reload this page.
[SPARK-32816][SQL][3.0] Fix analyzer bug when aggregating multiple distinct DECIMAL columns - #30053
[SPARK-32816][SQL][3.0] Fix analyzer bug when aggregating multiple distinct DECIMAL columns#30053linhongliu-db wants to merge 2 commits into
Conversation
SparkQA
commented
Oct 15, 2020
Test build #129826 has finished for PR 30053 at commit
|
SparkQA
commented
Oct 15, 2020
Kubernetes integration test starting |
SparkQA
commented
Oct 15, 2020
Kubernetes integration test status failure |
linhongliu-db
commented
Oct 16, 2020
This PR depends on #30052 to pass tests |
…t DECIMAL columns This PR fixes a conflict between `RewriteDistinctAggregates` and `DecimalAggregates`. In some cases, `DecimalAggregates` will wrap the decimal column to `UnscaledValue` using different rules for different aggregates. This means, same distinct column with different aggregates will change to different distinct columns after `DecimalAggregates`. For example: `avg(distinct decimal_col), sum(distinct decimal_col)` may change to `avg(distinct UnscaledValue(decimal_col)), sum(distinct decimal_col)` We assume after `RewriteDistinctAggregates`, there will be at most one distinct column in aggregates, but `DecimalAggregates` breaks this assumption. To fix this, we have to switch the order of these two rules. bug fix no added test cases Closesapache#29673 from linhongliu-db/SPARK-32816. Authored-by: Linhong Liu <linhong.liu@databricks.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com> (cherry picked from commit 40ef5c9)
b043f94 to
2634588CompareSparkQA
commented
Oct 16, 2020
Kubernetes integration test starting |
SparkQA
commented
Oct 16, 2020
Kubernetes integration test status failure |
SparkQA
commented
Oct 16, 2020
Test build #129876 has finished for PR 30053 at commit
|
linhongliu-db
commented
Oct 16, 2020
retest this please |
SparkQA
commented
Oct 16, 2020
Kubernetes integration test starting |
SparkQA
commented
Oct 16, 2020
Kubernetes integration test status failure |
SparkQA
commented
Oct 16, 2020
Kubernetes integration test starting |
SparkQA
commented
Oct 16, 2020
Kubernetes integration test status failure |
SparkQA
commented
Oct 16, 2020
Test build #129881 has finished for PR 30053 at commit
|
SparkQA
commented
Oct 16, 2020
Test build #129882 has finished for PR 30053 at commit
|
linhongliu-db
commented
Oct 19, 2020
@cloud-fan This PR depends on another 2 fixes in the master branch. Should we cherry-pick them? |
cloud-fan
commented
Oct 22, 2020
ah, that two are hard to backport as they change streaming state store. I guess we can't backport this fix either. |
linhongliu-db
commented
Oct 22, 2020
got it. Let's close it for now |
What changes were proposed in this pull request?
This PR fixes a conflict between
RewriteDistinctAggregatesandDecimalAggregates.In some cases,
DecimalAggregateswill wrap the decimal column toUnscaledValueusingdifferent rules for different aggregates.
This means, same distinct column with different aggregates will change to different distinct columns
after
DecimalAggregates. For example:avg(distinct decimal_col), sum(distinct decimal_col)may change toavg(distinct UnscaledValue(decimal_col)), sum(distinct decimal_col)We assume after
RewriteDistinctAggregates, there will be at most one distinct column in aggregates,but
DecimalAggregatesbreaks this assumption. To fix this, we have to switch the order of these tworules.
Why are the changes needed?
bug fix
Does this PR introduce any user-facing change?
no
How was this patch tested?
added test cases
Authored-by: Linhong Liu linhong.liu@databricks.com
Signed-off-by: Wenchen Fan wenchen@databricks.com
(cherry picked from commit 40ef5c9)