Verifying the RETENTION aggregate-function page (sql-manual/sql-functions/aggregate-functions/retention.md) on a live cluster (master daily; same text in version-3.x / version-4.x) surfaced two doc bugs. The page creates its own tables, so these are content errors, not missing setup.
Bug 1 — example 4 queries a column that doesn't exist (errors instead of returning NULL)
SELECT RETENTION(date = '2022-10-12') AS r FROM retention_test2 where uid is NULL;
retention_test2 is defined as (uid int, flag boolean, flag2 boolean) — there is no date column, so this fails with:
errCode = 2, detailMessage = Unknown column 'date' in 'table list'.
The example's intent ("empty aggregation returns NULL") would be shown correctly with a column that exists, e.g. SELECT RETENTION(flag) AS r FROM retention_test2 WHERE uid IS NULL; (the WHERE uid IS NULL already filters to zero rows → NULL).
Bug 2 — example 3 printed output contradicts its own INSERT
INSERT into retention_test2 values (0, false, false), (1, true, NULL);
SELECT * from retention_test2;
The doc prints:
| uid | flag | flag2 |
| 0 | 1 | NULL |
| 1 | 0 | 0 |
but the inserted rows are (0, false, false) and (1, true, NULL), i.e. the actual result is (0, 0, 0) and (1, 1, NULL). The printed flag/flag2 values don't match the INSERT (they look transposed). The expected output should be corrected to match the data.
Both reproduce on a fresh single-BE cluster. Happy to send a PR correcting example 4's column and example 3's expected output if that direction is agreed.
Verifying the
RETENTIONaggregate-function page (sql-manual/sql-functions/aggregate-functions/retention.md) on a live cluster (master daily; same text in version-3.x / version-4.x) surfaced two doc bugs. The page creates its own tables, so these are content errors, not missing setup.Bug 1 — example 4 queries a column that doesn't exist (errors instead of returning NULL)
retention_test2is defined as(uid int, flag boolean, flag2 boolean)— there is nodatecolumn, so this fails with:errCode = 2, detailMessage = Unknown column 'date' in 'table list'.The example's intent ("empty aggregation returns NULL") would be shown correctly with a column that exists, e.g.
SELECT RETENTION(flag) AS r FROM retention_test2 WHERE uid IS NULL;(theWHERE uid IS NULLalready filters to zero rows → NULL).Bug 2 — example 3 printed output contradicts its own INSERT
The doc prints:
but the inserted rows are
(0, false, false)and(1, true, NULL), i.e. the actual result is(0, 0, 0)and(1, 1, NULL). The printed flag/flag2 values don't match the INSERT (they look transposed). The expected output should be corrected to match the data.Both reproduce on a fresh single-BE cluster. Happy to send a PR correcting example 4's column and example 3's expected output if that direction is agreed.