Skip to content

Commit

Permalink
[typo](docs) modify bitmap function document (apache#21721)
Browse files Browse the repository at this point in the history
  • Loading branch information
vinlee19 authored Jul 13, 2023
1 parent 06d129c commit 8a42ba5
Show file tree
Hide file tree
Showing 16 changed files with 186 additions and 99 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ mysql> select bitmap_count(bitmap_and(to_bitmap(1), to_bitmap(2))) cnt;
| 0 |
+------+
mysql> select bitmap_to_string(bitmap_and(to_bitmap(1), to_bitmap(2)));
+----------------------------------------------------------+
| bitmap_to_string(bitmap_and(to_bitmap(1), to_bitmap(2))) |
+----------------------------------------------------------+
| |
+----------------------------------------------------------+
mysql> select bitmap_count(bitmap_and(to_bitmap(1), to_bitmap(1))) cnt;
+------+
| cnt |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,27 @@ mysql> select bitmap_count(bitmap_and_not(bitmap_from_string('1,2,3'),bitmap_fro
+------+
| 2 |
+------+
mysql> select bitmap_to_string(bitmap_and_not(bitmap_from_string('1,2,3'),bitmap_from_string('3,4,5')));
+--------------------------------------------------------------------------------------------+
| bitmap_to_string(bitmap_and_not(bitmap_from_string('1,2,3'), bitmap_from_string('3,4,5'))) |
+--------------------------------------------------------------------------------------------+
| 1,2 |
+--------------------------------------------------------------------------------------------+
mysql> select bitmap_to_string(bitmap_and_not(bitmap_from_string('1,2,3'),bitmap_empty())) ;
+-------------------------------------------------------------------------------+
| bitmap_to_string(bitmap_and_not(bitmap_from_string('1,2,3'), bitmap_empty())) |
+-------------------------------------------------------------------------------+
| 1,2,3 |
+-------------------------------------------------------------------------------+
mysql> select bitmap_to_string(bitmap_and_not(bitmap_from_string('1,2,3'),NULL));
+---------------------------------------------------------------------+
| bitmap_to_string(bitmap_and_not(bitmap_from_string('1,2,3'), NULL)) |
+---------------------------------------------------------------------+
| NULL |
+---------------------------------------------------------------------+
```

### keywords
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ mysql> select bitmap_count(bitmap_empty());
+------------------------------+
| 0 |
+------------------------------+
mysql> select bitmap_to_string(bitmap_empty());
+----------------------------------+
| bitmap_to_string(bitmap_empty()) |
+----------------------------------+
| |
+----------------------------------+
```

### keywords
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ Returns true if the second bitmap contains an empty element.
### example

```
mysql> select bitmap_has_all(bitmap_from_string("0, 1, 2"), bitmap_from_string("1, 2")) cnt;
+------+
| cnt |
+------+
| 1 |
+------+
mysql> select bitmap_has_all(bitmap_empty(), bitmap_from_string("1, 2")) cnt;
+------+
| cnt |
+------+
| 0 |
+------+
mysql> select bitmap_has_all(bitmap_from_string("0, 1, 2"), bitmap_from_string("1, 2"));
+---------------------------------------------------------------------------+
| bitmap_has_all(bitmap_from_string('0, 1, 2'), bitmap_from_string('1, 2')) |
+---------------------------------------------------------------------------+
| 1 |
+---------------------------------------------------------------------------+
mysql> select bitmap_has_all(bitmap_empty(), bitmap_from_string("1, 2"));
+------------------------------------------------------------+
| bitmap_has_all(bitmap_empty(), bitmap_from_string('1, 2')) |
+------------------------------------------------------------+
| 0 |
+------------------------------------------------------------+
```

### keywords
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ Calculate whether there are intersecting elements in the two Bitmap columns. The
### example

```
mysql> select bitmap_has_any(to_bitmap(1),to_bitmap(2)) cnt;
+------+
| cnt |
+------+
| 0 |
+------+
mysql> select bitmap_has_any(to_bitmap(1),to_bitmap(1)) cnt;
+------+
| cnt |
+------+
| 1 |
+------+
mysql> select bitmap_has_any(to_bitmap(1),to_bitmap(2));
+--------------------------------------------+
| bitmap_has_any(to_bitmap(1), to_bitmap(2)) |
+--------------------------------------------+
| 0 |
+--------------------------------------------+
mysql> select bitmap_has_any(to_bitmap(1),to_bitmap(1));
+--------------------------------------------+
| bitmap_has_any(to_bitmap(1), to_bitmap(1)) |
+--------------------------------------------+
| 1 |
+--------------------------------------------+
```

### keywords
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ cat data | curl --location-trusted -u user:passwd -T - -H "columns: dt,page,devi
### example

```
mysql> select bitmap_count(bitmap_hash64('hello'));
+------------------------------------+
| bitmap_count(bitmap_hash64('hello')) |
+------------------------------------+
| 1 |
+------------------------------------+
mysql> select bitmap_to_string(bitmap_hash64('hello'));
+------------------------------------------+
| bitmap_to_string(bitmap_hash64('hello')) |
+------------------------------------------+
| 15231136565543391023 |
+------------------------------------------+
```

### keywords
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ Calculate the set after lhs minus rhs, return the new bitmap.
### example

```
mysql> select bitmap_count(bitmap_not(bitmap_from_string('2,3'),bitmap_from_string('1,2,3,4'))) cnt;
+------+
| cnt |
+------+
| 0 |
+------+
mysql> select bitmap_to_string(bitmap_not(bitmap_from_string('2,3,5'),bitmap_from_string('1,2,3,4')));
mysql> select bitmap_to_string(bitmap_not(bitmap_from_string('2,3'),bitmap_from_string('1,2,3,4')));
+----------------------------------------------------------------------------------------+
| bitmap_to_string(bitmap_xor(bitmap_from_string('2,3,5'), bitmap_from_string('1,2,3,4'))) |
| bitmap_to_string(bitmap_not(bitmap_from_string('2,3'), bitmap_from_string('1,2,3,4'))) |
+----------------------------------------------------------------------------------------+
| 5 |
| |
+----------------------------------------------------------------------------------------+
mysql> select bitmap_to_string(bitmap_not(bitmap_from_string('2,3,5'),bitmap_from_string('1,2,3,4')));
+------------------------------------------------------------------------------------------+
| bitmap_to_string(bitmap_not(bitmap_from_string('2,3,5'), bitmap_from_string('1,2,3,4'))) |
+------------------------------------------------------------------------------------------+
| 5 |
+------------------------------------------------------------------------------------------+
```

### keywords
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,42 +35,49 @@ Compute union of two or more input bitmaps, returns the new bitmap.
### example

```
mysql> select bitmap_count(bitmap_or(to_bitmap(1), to_bitmap(2))) cnt;
mysql> select bitmap_count(bitmap_or(to_bitmap(1), to_bitmap(1))) cnt;
+------+
| cnt |
+------+
| 2 |
| 1 |
+------+
mysql> select bitmap_count(bitmap_or(to_bitmap(1), to_bitmap(1))) cnt;
mysql> select bitmap_to_string(bitmap_or(to_bitmap(1), to_bitmap(1))) ;
+---------------------------------------------------------+
| bitmap_to_string(bitmap_or(to_bitmap(1), to_bitmap(1))) |
+---------------------------------------------------------+
| 1 |
+---------------------------------------------------------+
mysql> select bitmap_count(bitmap_or(to_bitmap(1), to_bitmap(2))) cnt;
+------+
| cnt |
+------+
| 1 |
| 2 |
+------+
MySQL> select bitmap_to_string(bitmap_or(to_bitmap(1), to_bitmap(2)));
mysql> select bitmap_to_string(bitmap_or(to_bitmap(1), to_bitmap(2)));
+---------------------------------------------------------+
| bitmap_to_string(bitmap_or(to_bitmap(1), to_bitmap(2))) |
+---------------------------------------------------------+
| 1,2 |
+---------------------------------------------------------+
MySQL> select bitmap_to_string(bitmap_or(to_bitmap(1), to_bitmap(2), to_bitmap(10), to_bitmap(0), NULL));
mysql> select bitmap_to_string(bitmap_or(to_bitmap(1), to_bitmap(2), to_bitmap(10), to_bitmap(0), NULL));
+--------------------------------------------------------------------------------------------+
| bitmap_to_string(bitmap_or(to_bitmap(1), to_bitmap(2), to_bitmap(10), to_bitmap(0), NULL)) |
+--------------------------------------------------------------------------------------------+
| NULL |
| 0,1,2,10 |
+--------------------------------------------------------------------------------------------+
MySQL> select bitmap_to_string(bitmap_or(to_bitmap(1), to_bitmap(2),to_bitmap(10),to_bitmap(0),bitmap_empty()));
mysql> select bitmap_to_string(bitmap_or(to_bitmap(1), to_bitmap(2),to_bitmap(10),to_bitmap(0),bitmap_empty()));
+------------------------------------------------------------------------------------------------------+
| bitmap_to_string(bitmap_or(to_bitmap(1), to_bitmap(2), to_bitmap(10), to_bitmap(0), bitmap_empty())) |
+------------------------------------------------------------------------------------------------------+
| 0,1,2,10 |
+------------------------------------------------------------------------------------------------------+
MySQL> select bitmap_to_string(bitmap_or(to_bitmap(10), bitmap_from_string('1,2'), bitmap_from_string('1,2,3,4,5'))) ;
mysql> select bitmap_to_string(bitmap_or(to_bitmap(10), bitmap_from_string('1,2'), bitmap_from_string('1,2,3,4,5'))) ;
+--------------------------------------------------------------------------------------------------------+
| bitmap_to_string(bitmap_or(to_bitmap(10), bitmap_from_string('1,2'), bitmap_from_string('1,2,3,4,5'))) |
+--------------------------------------------------------------------------------------------------------+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ mysql> select bitmap_count(bitmap_and(to_bitmap(1), to_bitmap(2))) cnt;
| 0 |
+------+
mysql> select bitmap_to_string(bitmap_and(to_bitmap(1), to_bitmap(2)));
+----------------------------------------------------------+
| bitmap_to_string(bitmap_and(to_bitmap(1), to_bitmap(2))) |
+----------------------------------------------------------+
| |
+----------------------------------------------------------+
mysql> select bitmap_count(bitmap_and(to_bitmap(1), to_bitmap(1))) cnt;
+------+
| cnt |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,28 @@ mysql> select bitmap_count(bitmap_and_not(bitmap_from_string('1,2,3'),bitmap_fro
+------+
| 2 |
+------+
mysql> select bitmap_to_string(bitmap_and_not(bitmap_from_string('1,2,3'),bitmap_from_string('3,4,5')));
+--------------------------------------------------------------------------------------------+
| bitmap_to_string(bitmap_and_not(bitmap_from_string('1,2,3'), bitmap_from_string('3,4,5'))) |
+--------------------------------------------------------------------------------------------+
| 1,2 |
+--------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)
mysql> select bitmap_to_string(bitmap_and_not(bitmap_from_string('1,2,3'),bitmap_empty())) ;
+-------------------------------------------------------------------------------+
| bitmap_to_string(bitmap_and_not(bitmap_from_string('1,2,3'), bitmap_empty())) |
+-------------------------------------------------------------------------------+
| 1,2,3 |
+-------------------------------------------------------------------------------+
mysql> select bitmap_to_string(bitmap_and_not(bitmap_from_string('1,2,3'),NULL));
+---------------------------------------------------------------------+
| bitmap_to_string(bitmap_and_not(bitmap_from_string('1,2,3'), NULL)) |
+---------------------------------------------------------------------+
| NULL |
+---------------------------------------------------------------------+
```

### keywords
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ mysql> select bitmap_count(bitmap_empty());
+------------------------------+
| 0 |
+------------------------------+
mysql> select bitmap_to_string(bitmap_empty());
+----------------------------------+
| bitmap_to_string(bitmap_empty()) |
+----------------------------------+
| |
+----------------------------------+
```

### keywords
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ under the License.
### example

```
mysql> select bitmap_has_all(bitmap_from_string("0, 1, 2"), bitmap_from_string("1, 2")) cnt;
+------+
| cnt |
+------+
| 1 |
+------+
mysql> select bitmap_has_all(bitmap_empty(), bitmap_from_string("1, 2")) cnt;
+------+
| cnt |
+------+
| 0 |
+------+
mysql> select bitmap_has_all(bitmap_from_string("0, 1, 2"), bitmap_from_string("1, 2"));
+---------------------------------------------------------------------------+
| bitmap_has_all(bitmap_from_string('0, 1, 2'), bitmap_from_string('1, 2')) |
+---------------------------------------------------------------------------+
| 1 |
+---------------------------------------------------------------------------+
mysql> select bitmap_has_all(bitmap_empty(), bitmap_from_string("1, 2"));
+------------------------------------------------------------+
| bitmap_has_all(bitmap_empty(), bitmap_from_string('1, 2')) |
+------------------------------------------------------------+
| 0 |
+------------------------------------------------------------+
```

### keywords
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ under the License.
### example

```
mysql> select bitmap_has_any(to_bitmap(1),to_bitmap(2)) cnt;
+------+
| cnt |
+------+
| 0 |
+------+
mysql> select bitmap_has_any(to_bitmap(1),to_bitmap(1)) cnt;
+------+
| cnt |
+------+
| 1 |
+------+
mysql> select bitmap_has_any(to_bitmap(1),to_bitmap(2));
+--------------------------------------------+
| bitmap_has_any(to_bitmap(1), to_bitmap(2)) |
+--------------------------------------------+
| 0 |
+--------------------------------------------+
mysql> select bitmap_has_any(to_bitmap(1),to_bitmap(1));
+--------------------------------------------+
| bitmap_has_any(to_bitmap(1), to_bitmap(1)) |
+--------------------------------------------+
| 1 |
+--------------------------------------------+
```

### keywords
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ cat data | curl --location-trusted -u user:passwd -T - -H "columns: dt,page,devi
### example

```
mysql> select bitmap_count(bitmap_hash64('hello'));
+------------------------------------+
| bitmap_count(bitmap_hash64('hello')) |
+------------------------------------+
| 1 |
+------------------------------------+
mysql> select bitmap_to_string(bitmap_hash64('hello'));
+------------------------------------------+
| bitmap_to_string(bitmap_hash64('hello')) |
+------------------------------------------+
| 15231136565543391023 |
+------------------------------------------+
```

### keywords
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,17 @@ under the License.
### example

```
mysql> select bitmap_count(bitmap_not(bitmap_from_string('2,3'),bitmap_from_string('1,2,3,4'))) cnt;
+------+
| cnt |
+------+
| 0 |
+------+
mysql> select bitmap_to_string(bitmap_not(bitmap_from_string('2,3'),bitmap_from_string('1,2,3,4')));
+----------------------------------------------------------------------------------------+
| bitmap_to_string(bitmap_not(bitmap_from_string('2,3'), bitmap_from_string('1,2,3,4'))) |
+----------------------------------------------------------------------------------------+
| |
+----------------------------------------------------------------------------------------+
1 row in set (0.01 sec)
mysql> select bitmap_to_string(bitmap_not(bitmap_from_string('2,3,5'),bitmap_from_string('1,2,3,4')));
+----------------------------------------------------------------------------------------+
| bitmap_to_string(bitmap_xor(bitmap_from_string('2,3,5'), bitmap_from_string('1,2,3,4'))) |
| bitmap_to_string(bitmap_not(bitmap_from_string('2,3,5'), bitmap_from_string('1,2,3,4'))) |
+----------------------------------------------------------------------------------------+
| 5 |
+----------------------------------------------------------------------------------------+
Expand Down
Loading

0 comments on commit 8a42ba5

Please sign in to comment.