leanken opened a new pull request #29983: URL: https://github.com/apache/spark/pull/29983
### What changes were proposed in this pull request? As [SPARK-13860](https://issues.apache.org/jira/browse/SPARK-13860) stated, TPCDS Query 39 returns wrong results using SparkSQL. The root cause is that when stddev_samp is applied to a single element set, with TPCDS answer, it return 0.0; as in SparkSQL, it return Double.NaN which caused the wrong result. Add a extra legacy config to fallback into the NaN logical, and return 0.0 by default to align with TPCDS standard. ### Why are the changes needed? SQL correctness issue. ### Does this PR introduce any user-facing change? No. ### How was this patch tested? Updated DataFrameAggregateSuite to test both default and legacy behavior. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
