boluor opened a new issue, #3904:
URL: https://github.com/apache/doris-website/issues/3904
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)**
```sql
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**
```sql
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.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]