jonmmease opened a new pull request, #4847:
URL: https://github.com/apache/arrow-datafusion/pull/4847
# Which issue does this PR close?
Closes #4843.
# Rationale for this change
Rather than crash when performing a variance-based aggregation on a single
value, follow Postgres' semantics:
- `var`/`stddev` of single element is `NULL`
- `var_pop`/`stddev_pop` of single element is 0
There's documentation of this behavior in Snowflake
(https://docs.snowflake.com/en/sql-reference/functions/stddev.html), and it's
what Postgres does, but in searching briefly I haven't found this behavior
described in the Postgres docs.
# Are these changes tested?
I added a pair of sqllogictest tests for the one and two element cases.
# Are there any user-facing changes?
Queries that used to crash when aggregating single values with
variance-based aggregations will no longer crash.
--
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]