You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 61ec845
Browse filesBrowse the repository at this point in the historyBrowse files
fix: reject DISTINCT in corr, covar and regr_* instead of ignoring it (apache#26484)
## Which issue does this PR close?
- Closesapache#26471.
## Rationale for this change
`corr`, `covar_pop`, `covar_samp` and the `regr_*` functions return the
same result with `DISTINCT` as without it, because their accumulators
never read `is_distinct`.
## What changes are included in this PR?
Their accumulators now return a not implemented error for `DISTINCT`, as
`stddev` and `approx_median` already do. `corr(DISTINCT x, x)` still
works, since `SingleDistinctToGroupBy` rewrites it before it reaches the
accumulator.
## What is the testing strategy for this PR?
New cases in `aggregate.slt`. The two `REGR_COUNT(DISTINCT ...)` results
in `eliminate_join_distinct.slt` were the non-distinct counts, so they
now expect the error.
## Are there any user-facing changes?
These queries now fail with an error instead of returning a wrong
result.
---------
Co-authored-by: Alejandro Borrego <[email protected]>
0 commit comments