Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---

Check notice on line 1 in i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/aggregate-functions/any-value.md

View workflow job for this annotation

GitHub Actions / Build Check

sql-function-section-order

SQL function docs must contain sections in this order%3A Description%2C Syntax%2C Parameters%2C Return Value%2C Example. Missing%3A Example. Owner%3A @zclllyybb

Check warning on line 1 in i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/aggregate-functions/any-value.md

View workflow job for this annotation

GitHub Actions / Build Check

seo-description-length

SEO description should be 80-160 characters; current length is 53. Owner%3A @zclllyybb
{
"title": "ANY_VALUE",
"language": "zh-CN",
Expand All @@ -13,13 +13,13 @@
## 别名

- ANY

Check notice on line 16 in i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/aggregate-functions/any-value.md

View workflow job for this annotation

GitHub Actions / Build Check

sql-function-parameters-table

Parameters section must be a Markdown table with Parameter and Description columns. Owner%3A @zclllyybb
## 语法

```sql
ANY_VALUE(<expr>)
```

Check notice on line 22 in i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/aggregate-functions/any-value.md

View workflow job for this annotation

GitHub Actions / Build Check

sql-function-return-type

Return Value section must state the returned type. Owner%3A @zclllyybb
## 参数

| 参数 | 说明 |
Expand All @@ -32,6 +32,12 @@

## 举例

```sql
-- setup
create table cost2(id int, name varchar(20)) distributed by hash(id) buckets 1 properties ("replication_num"="1");
insert into cost2 values (2,'jack'),(3,'jack');
```

```sql
select id, any_value(name) from cost2 group by id;
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---

Check notice on line 1 in i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/aggregate-functions/array-agg.md

View workflow job for this annotation

GitHub Actions / Build Check

sql-function-section-order

SQL function docs must contain sections in this order%3A Description%2C Syntax%2C Parameters%2C Return Value%2C Example. Missing%3A Example. Owner%3A @zclllyybb

Check warning on line 1 in i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/aggregate-functions/array-agg.md

View workflow job for this annotation

GitHub Actions / Build Check

seo-description-length

SEO description should be 80-160 characters; current length is 40. Owner%3A @zclllyybb
{
"title": "ARRAY_AGG",
"language": "zh-CN",
Expand All @@ -9,13 +9,13 @@
## 描述

将一列中的值(包括空值 null)串联成一个数组,可以用于多行转一行(行转列)。

Check notice on line 12 in i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/aggregate-functions/array-agg.md

View workflow job for this annotation

GitHub Actions / Build Check

sql-function-parameters-table

Parameters section must be a Markdown table with Parameter and Description columns. Owner%3A @zclllyybb
## 语法

```sql
ARRAY_AGG(<col>)
```

Check notice on line 18 in i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/aggregate-functions/array-agg.md

View workflow job for this annotation

GitHub Actions / Build Check

sql-function-return-null

Return Value section must document NULL return conditions%2C including when the function never returns NULL. Owner%3A @zclllyybb
## 参数

| 参数 | 说明 |
Expand All @@ -31,6 +31,12 @@

## 举例

```sql
-- setup
create table test_doris_array_agg(c1 int, c2 varchar(20)) distributed by hash(c1) buckets 1 properties ("replication_num"="1");
insert into test_doris_array_agg values (1,'a'),(1,'b'),(2,'c'),(2,null),(3,null);
```

```sql
select * from test_doris_array_agg;
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---

Check notice on line 1 in i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/aggregate-functions/avg-weighted.md

View workflow job for this annotation

GitHub Actions / Build Check

sql-function-section-order

SQL function docs must contain sections in this order%3A Description%2C Syntax%2C Parameters%2C Return Value%2C Example. Missing%3A Example. Owner%3A @zclllyybb
{
"title": "AVG_WEIGHTED",
"language": "zh-CN",
Expand All @@ -9,14 +9,14 @@
## 描述

计算加权算术平均值,即返回结果为:所有对应数值和权重的乘积相累加,除总的权重和。如果所有的权重和等于 0, 将返回 NaN。

Check notice on line 12 in i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/aggregate-functions/avg-weighted.md

View workflow job for this annotation

GitHub Actions / Build Check

sql-function-parameters-table

Parameters section must be a Markdown table with Parameter and Description columns. Owner%3A @zclllyybb
## 语法

```sql
AVG_WEIGHTED(<x>, <weight>)
```

## 参数

Check notice on line 19 in i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/aggregate-functions/avg-weighted.md

View workflow job for this annotation

GitHub Actions / Build Check

sql-function-return-null

Return Value section must document NULL return conditions%2C including when the function never returns NULL. Owner%3A @zclllyybb

Check notice on line 19 in i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/aggregate-functions/avg-weighted.md

View workflow job for this annotation

GitHub Actions / Build Check

sql-function-return-type

Return Value section must state the returned type. Owner%3A @zclllyybb

| 参数 | 说明 |
| -- | -- |
Expand All @@ -29,6 +29,12 @@

## 举例

```sql
-- setup
create table test_doris_avg_weighted(k1 int, k2 int) distributed by hash(k1) buckets 1 properties ("replication_num"="1");
insert into test_doris_avg_weighted values (10,100),(20,200),(30,300),(40,400);
```

```sql
select k1,k2 from test_doris_avg_weighted;
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@

## 举例

```sql
-- setup
create table pv_bitmap(dt int, page int, user_id bitmap bitmap_union) aggregate key(dt,page) distributed by hash(dt) buckets 1 properties ("replication_num"="1");
insert into pv_bitmap values (1,100,bitmap_from_string('100,200,300')),(2,200,bitmap_from_string('300'));
```

```sql
select dt,page,bitmap_to_string(user_id) from pv_bitmap;
```
Expand All @@ -36,7 +42,7 @@
+------+------+---------------------------+
| dt | page | bitmap_to_string(user_id) |
+------+------+---------------------------+
| 1 | 100 | 100,200,300 |

Check warning on line 45 in i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/aggregate-functions/bitmap-union-count.md

View workflow job for this annotation

GitHub Actions / Build Check

markdown-code-fence-language

Code fence should declare a language. Owner%3A @zclllyybb
| 2 | 200 | 300 |
+------+------+---------------------------+
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@

## 举例

```sql
-- setup
create table pv_bitmap(dt int, page int, user_id bitmap bitmap_union) aggregate key(dt,page) distributed by hash(dt) buckets 1 properties ("replication_num"="1");
insert into pv_bitmap values (1,100,bitmap_from_string('100,200,300')),(1,300,bitmap_from_string('300')),(2,200,bitmap_from_string('300'));
```

```sql
select dt,page,bitmap_to_string(user_id) from pv_bitmap;
```
Expand All @@ -35,7 +41,7 @@
```text
+------+------+---------------------------+
| dt | page | bitmap_to_string(user_id) |
+------+------+---------------------------+

Check warning on line 44 in i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/aggregate-functions/bitmap-union-int.md

View workflow job for this annotation

GitHub Actions / Build Check

markdown-code-fence-language

Code fence should declare a language. Owner%3A @zclllyybb
| 1 | 100 | 100,200,300 |
| 1 | 300 | 300 |
| 2 | 200 | 300 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ GROUP_BIT_AND(<expr>)

## 举例

```sql
-- setup
create table group_bit(value int) distributed by hash(value) buckets 1 properties ("replication_num"="1");
insert into group_bit values (3),(1),(2),(4);
```

```sql
select * from group_bit;
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ GROUP_BIT_OR(<expr>)

## 举例

```sql
-- setup
create table group_bit(value int) distributed by hash(value) buckets 1 properties ("replication_num"="1");
insert into group_bit values (3),(1),(2),(4);
```

```sql
select * from group_bit;
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@
返回一个整数值

## 举例

Check warning on line 30 in i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/aggregate-functions/group-bit-xor.md

View workflow job for this annotation

GitHub Actions / Build Check

markdown-code-fence-language

Code fence should declare a language. Owner%3A @zclllyybb
```sql
-- setup
create table group_bit(value int) distributed by hash(value) buckets 1 properties ("replication_num"="1");
insert into group_bit values (3),(1),(2),(4);
```

```
select * from group_bit;
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ GROUP_BITMAP_XOR(<expr>)

## 举例

```sql
-- setup
create table pv_bitmap(id int, page varchar(10), user_id bitmap bitmap_union) aggregate key(id,page) distributed by hash(id) buckets 1 properties ("replication_num"="1");
insert into pv_bitmap values (1,'m',bitmap_from_string('4,7,8')),(2,'m',bitmap_from_string('1,3,6,15')),(3,'m',bitmap_from_string('4,7'));
```

```sql
select page, bitmap_to_string(user_id) from pv_bitmap;
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ INTERSECT_COUNT(<bitmap_column>, <column_to_filter>, <filter_values>)

## 举例

```sql
-- setup
create table pv_bitmap(dt int, user_id bitmap bitmap_union) aggregate key(dt) distributed by hash(dt) buckets 1 properties ("replication_num"="1");
insert into pv_bitmap values (4,bitmap_from_string('1,2,3')),(3,bitmap_from_string('1,2,3,4,5'));
```

```sql
select dt,bitmap_to_string(user_id) from pv_bitmap where dt in (3,4);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ MAX_BY(<expr1>, <expr2>)

## 举例

```sql
-- setup
create table tbl(k1 int, k2 int, k3 int, k4 int) distributed by hash(k1) buckets 1 properties ("replication_num"="1");
insert into tbl values (0,3,2,100),(1,2,3,4),(4,3,2,1),(3,4,2,1);
```

```sql
select * from tbl;
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ ANY_VALUE(<expr>)

## 举例

```sql
-- setup
create table cost2(id int, name varchar(20)) distributed by hash(id) buckets 1 properties ("replication_num"="1");
insert into cost2 values (2,'jack'),(3,'jack');
```

```sql
select id, any_value(name) from cost2 group by id;
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ ARRAY_AGG(<col>)

## 举例

```sql
-- setup
create table test_doris_array_agg(c1 int, c2 varchar(20)) distributed by hash(c1) buckets 1 properties ("replication_num"="1");
insert into test_doris_array_agg values (1,'a'),(1,'b'),(2,'c'),(2,null),(3,null);
```

```sql
select * from test_doris_array_agg;
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ AVG_WEIGHTED(<x>, <weight>)

## 举例

```sql
-- setup
create table test_doris_avg_weighted(k1 int, k2 int) distributed by hash(k1) buckets 1 properties ("replication_num"="1");
insert into test_doris_avg_weighted values (10,100),(20,200),(30,300),(40,400);
```

```sql
select k1,k2 from test_doris_avg_weighted;
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@

## 举例

```sql
-- setup
create table pv_bitmap(dt int, page int, user_id bitmap bitmap_union) aggregate key(dt,page) distributed by hash(dt) buckets 1 properties ("replication_num"="1");
insert into pv_bitmap values (1,100,bitmap_from_string('100,200,300')),(2,200,bitmap_from_string('300'));
```

```sql
select dt,page,bitmap_to_string(user_id) from pv_bitmap;
```
Expand All @@ -36,7 +42,7 @@
+------+------+---------------------------+
| dt | page | bitmap_to_string(user_id) |
+------+------+---------------------------+
| 1 | 100 | 100,200,300 |

Check warning on line 45 in i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/sql-manual/sql-functions/aggregate-functions/bitmap-union-count.md

View workflow job for this annotation

GitHub Actions / Build Check

markdown-code-fence-language

Code fence should declare a language. Owner%3A @zclllyybb
| 2 | 200 | 300 |
+------+------+---------------------------+
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@

## 举例

```sql
-- setup
create table pv_bitmap(dt int, page int, user_id bitmap bitmap_union) aggregate key(dt,page) distributed by hash(dt) buckets 1 properties ("replication_num"="1");
insert into pv_bitmap values (1,100,bitmap_from_string('100,200,300')),(1,300,bitmap_from_string('300')),(2,200,bitmap_from_string('300'));
```

```sql
select dt,page,bitmap_to_string(user_id) from pv_bitmap;
```
Expand All @@ -35,7 +41,7 @@
```text
+------+------+---------------------------+
| dt | page | bitmap_to_string(user_id) |
+------+------+---------------------------+

Check warning on line 44 in i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/sql-manual/sql-functions/aggregate-functions/bitmap-union-int.md

View workflow job for this annotation

GitHub Actions / Build Check

markdown-code-fence-language

Code fence should declare a language. Owner%3A @zclllyybb
| 1 | 100 | 100,200,300 |
| 1 | 300 | 300 |
| 2 | 200 | 300 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ GROUP_BIT_AND(<expr>)

## 举例

```sql
-- setup
create table group_bit(value int) distributed by hash(value) buckets 1 properties ("replication_num"="1");
insert into group_bit values (3),(1),(2),(4);
```

```sql
select * from group_bit;
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ GROUP_BIT_OR(<expr>)

## 举例

```sql
-- setup
create table group_bit(value int) distributed by hash(value) buckets 1 properties ("replication_num"="1");
insert into group_bit values (3),(1),(2),(4);
```

```sql
select * from group_bit;
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@
返回一个整数值

## 举例

Check warning on line 30 in i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/sql-manual/sql-functions/aggregate-functions/group-bit-xor.md

View workflow job for this annotation

GitHub Actions / Build Check

markdown-code-fence-language

Code fence should declare a language. Owner%3A @zclllyybb
```sql
-- setup
create table group_bit(value int) distributed by hash(value) buckets 1 properties ("replication_num"="1");
insert into group_bit values (3),(1),(2),(4);
```

```
select * from group_bit;
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ GROUP_BITMAP_XOR(<expr>)

## 举例

```sql
-- setup
create table pv_bitmap(id int, page varchar(10), user_id bitmap bitmap_union) aggregate key(id,page) distributed by hash(id) buckets 1 properties ("replication_num"="1");
insert into pv_bitmap values (1,'m',bitmap_from_string('4,7,8')),(2,'m',bitmap_from_string('1,3,6,15')),(3,'m',bitmap_from_string('4,7'));
```

```sql
select page, bitmap_to_string(user_id) from pv_bitmap;
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ INTERSECT_COUNT(<bitmap_column>, <column_to_filter>, <filter_values>)

## 举例

```sql
-- setup
create table pv_bitmap(dt int, user_id bitmap bitmap_union) aggregate key(dt) distributed by hash(dt) buckets 1 properties ("replication_num"="1");
insert into pv_bitmap values (4,bitmap_from_string('1,2,3')),(3,bitmap_from_string('1,2,3,4,5'));
```

```sql
select dt,bitmap_to_string(user_id) from pv_bitmap where dt in (3,4);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ MAX_BY(<expr1>, <expr2>)

## 举例

```sql
-- setup
create table tbl(k1 int, k2 int, k3 int, k4 int) distributed by hash(k1) buckets 1 properties ("replication_num"="1");
insert into tbl values (0,3,2,100),(1,2,3,4),(4,3,2,1),(3,4,2,1);
```

```sql
select * from tbl;
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ Returns any non-NULL value if a non-NULL value exists, otherwise returns NULL.

## Example

```sql
-- setup
create table cost2(id int, name varchar(20)) distributed by hash(id) buckets 1 properties ("replication_num"="1");
insert into cost2 values (2,'jack'),(3,'jack');
```

```sql
select id, any_value(name) from cost2 group by id;
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ Returns a value of ARRAY type.Special cases:

## Example

```sql
-- setup
create table test_doris_array_agg(c1 int, c2 varchar(20)) distributed by hash(c1) buckets 1 properties ("replication_num"="1");
insert into test_doris_array_agg values (1,'a'),(1,'b'),(2,'c'),(2,null),(3,null);
```

```sql
select * from test_doris_array_agg;
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ The sum of the products of corresponding values and weights is accumulated, divi

## Example

```sql
-- setup
create table test_doris_avg_weighted(k1 int, k2 int) distributed by hash(k1) buckets 1 properties ("replication_num"="1");
insert into test_doris_avg_weighted values (10,100),(20,200),(30,300),(40,400);
```

```sql
select k1,k2 from test_doris_avg_weighted;
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@

## Example

```sql
-- setup
create table pv_bitmap(dt int, page int, user_id bitmap bitmap_union) aggregate key(dt,page) distributed by hash(dt) buckets 1 properties ("replication_num"="1");
insert into pv_bitmap values (1,100,bitmap_from_string('100,200,300')),(2,200,bitmap_from_string('300'));
```

```sql
select dt,page,bitmap_to_string(user_id) from pv_bitmap;
```
Expand All @@ -36,7 +42,7 @@
+------+------+---------------------------+
| dt | page | bitmap_to_string(user_id) |
+------+------+---------------------------+
| 1 | 100 | 100,200,300 |

Check warning on line 45 in versioned_docs/version-2.1/sql-manual/sql-functions/aggregate-functions/bitmap-union-count.md

View workflow job for this annotation

GitHub Actions / Build Check

markdown-code-fence-language

Code fence should declare a language. Owner%3A @zclllyybb
| 2 | 200 | 300 |
+------+------+---------------------------+
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ Returns the number of distinct values in a column.

## Example

```sql
-- setup
create table pv_bitmap(dt int, page int, user_id bitmap bitmap_union) aggregate key(dt,page) distributed by hash(dt) buckets 1 properties ("replication_num"="1");
insert into pv_bitmap values (1,100,bitmap_from_string('100,200,300')),(1,300,bitmap_from_string('300')),(2,200,bitmap_from_string('300'));
```

```sql
select dt,page,bitmap_to_string(user_id) from pv_bitmap;
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ Returns an integer value.

## Example

```sql
-- setup
create table group_bit(value int) distributed by hash(value) buckets 1 properties ("replication_num"="1");
insert into group_bit values (3),(1),(2),(4);
```

```sql
select * from group_bit;
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ Returns an integer value

## Example

```sql
-- setup
create table group_bit(value int) distributed by hash(value) buckets 1 properties ("replication_num"="1");
insert into group_bit values (3),(1),(2),(4);
```

```sql
select * from group_bit;
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ Returns an integer value

## Example

```sql
-- setup
create table group_bit(value int) distributed by hash(value) buckets 1 properties ("replication_num"="1");
insert into group_bit values (3),(1),(2),(4);
```

```sql
select * from group_bit;
```
Expand Down
Loading
Loading