apache / apache/doris-website

doc bug: GROUP_ARRAY_INTERSECT example SQL does not match its output (version-3.x/2.1)

Open
#3,886 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
MDX
Stars
133
Forks
464
Avg merge
1d 1h
Merged PRs (30d)
50

Description

On the `GROUP_ARRAY_INTERSECT` page (`aggregate-functions/group-array-intersect.md`, version-3.x and version-2.1), the first example does not match its own output:

```sql
select c_array_string from group_array_intersect_test where id in (18, 20);
```
```text
+------+---------------------------+
| id | col |
+------+---------------------------+
| 1 | ["a", "b", "c", "d", "e"] |
| 2 | ["a", "b"] |
| 3 | ["a", null] |
+------+---------------------------+
```

The SQL selects a single column `c_array_string` with predicate `id IN (18, 20)`, but the shown output has columns `id | col` and rows with `id` = 1, 2, 3 (which contradicts the `IN (18, 20)` filter). The SQL and the displayed result are inconsistent.

Suggested fix — make the SQL match the shown two-column output and rows, e.g.:
```sql
select id, col from group_array_intersect_test;
```
(The second example, `select group_array_intersect(col) from group_array_intersect_test;` → `["a"]`, is consistent and fine.)

Filing this separately so the example-SQL correction can be reviewed on its own; the missing `CREATE TABLE` setup for these pages is being handled in the Line-B setup PRs.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.