Analytic REGR_* functions and COVAR_POP return internval server error in combination with UNION ALL
Details
| Detail name | Value |
|---|---|
| Changelog Number | 12251 |
| Type | Bug |
| Status | Resolved |
| Affected Versions | Exasol 6.2.0, Exasol 7.0.0 |
| Fix Versions | Exasol 6.2.15, Exasol 7.0.10 |
| Resolution Date | 2021-05-25 |
In some cases, using one of the REGR_* functions or COVAR_POP as an analytic function together with an UNION ALL expression can lead to an internal server error:
SELECT
REGR_SLOPE(a,b) over()
FROM
(SELECT 1 as a, 2 as b UNION ALL SELECT 2 as a, 3 as b)
Replace the REGR_* and COVAR_POP calls with the definitions from the documentation. For example:
SELECT
((SUM(a*b) over() - (SUM(a-a+b) over() * SUM(b-b+a) over()) / COUNT(a+b) over()) / COUNT(a+b) over()) / VAR_POP(b) over()
FROM
(SELECT 1 as a, 2 as b UNION ALL SELECT 2 as a, 3 as b)
These situations will no longer lead to an internal server error.