[SPARK-35987][SQL] The ANSI flags of Sum and Avg should be kept after being copied#33186
[SPARK-35987][SQL] The ANSI flags of Sum and Avg should be kept after being copied#33186gengliangwang wants to merge 4 commits intoapache:masterfrom
Conversation
|
Test build #140572 has finished for PR 33186 at commit
|
|
Kubernetes integration test starting |
|
Kubernetes integration test status success |
|
Kubernetes integration test starting |
|
Kubernetes integration test status success |
|
Test build #140617 has finished for PR 33186 at commit
|
|
|
||
| override protected def withNewChildInternal(newChild: Expression): Sum = copy(child = newChild) | ||
|
|
||
| // The flag `failOnError` won't be shown in the `toString` or `toAggString` methods |
There was a problem hiding this comment.
Just to make sure, are these same with other expressions? other places might have to be fixed (in a separate PR)
There was a problem hiding this comment.
The basic math operations (Add, Subtract, etc.) just print something like a + b without showing the ANSI flag. This makes sense to me.
|
thanks, merging to master/3.2! |
… being copied ### What changes were proposed in this pull request? Make the ANSI flag part of expressions `Sum` and `Average`'s parameter list, instead of fetching it from the sessional SQLConf. ### Why are the changes needed? For Views, it is important to show consistent results even the ANSI configuration is different in the running session. This is why many expressions like 'Add'/'Divide' making the ANSI flag part of its case class parameter list. We should make it consistent for the expressions `Sum` and `Average` ### Does this PR introduce _any_ user-facing change? Yes, the `Sum` and `Average` inside a View always behaves the same, independent of the ANSI model SQL configuration in the current session. ### How was this patch tested? Existing UT Closes #33186 from gengliangwang/sumAndAvg. Authored-by: Gengliang Wang <gengliang@apache.org> Signed-off-by: Wenchen Fan <wenchen@databricks.com> (cherry picked from commit 51103cd) Signed-off-by: Wenchen Fan <wenchen@databricks.com>
What changes were proposed in this pull request?
Make the ANSI flag part of expressions
SumandAverage's parameter list, instead of fetching it from the sessional SQLConf.Why are the changes needed?
For Views, it is important to show consistent results even the ANSI configuration is different in the running session. This is why many expressions like 'Add'/'Divide' making the ANSI flag part of its case class parameter list.
We should make it consistent for the expressions
SumandAverageDoes this PR introduce any user-facing change?
Yes, the
SumandAverageinside a View always behaves the same, independent of the ANSI model SQL configuration in the current session.How was this patch tested?
Existing UT