[Document](function) add docs of hll_cardinality/hll_empty/hll_hash (#14547)

This commit is contained in:
Jerry Hu
2022-11-27 13:40:16 +08:00
committed by GitHub
parent 93b940bc92
commit cf2de85633
8 changed files with 285 additions and 1 deletions

View File

@ -155,6 +155,10 @@
"message": "Hash 函数",
"description": "The label for category Hash Functions in sidebar docs"
},
"sidebar.docs.category.HLL Functions": {
"message": "HLL 函数",
"description": "The label for category HLL Functions in sidebar docs"
},
"sidebar.docs.category.Math Functions": {
"message": "数学函数",
"description": "The label for category Math Functions in sidebar docs"

View File

@ -0,0 +1,45 @@
---
{
"title": "HLL_CARDINALITY",
"language": "en"
}
---
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
## HLL_CARDINALITY
### description
#### Syntax
`HLL_CARDINALITY(hll)`
HLL_CARDINALITY is used to calculate the cardinality of a single HLL type value.
### example
```
MySQL > select HLL_CARDINALITY(uv_set) from test_uv;
+---------------------------+
| hll_cardinality(`uv_set`) |
+---------------------------+
| 3 |
+---------------------------+
```
### keywords
HLL,HLL_CARDINALITY

View File

@ -0,0 +1,45 @@
---
{
"title": "HLL_EMPTY",
"language": "en"
}
---
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
## HLL_EMPTY
### description
#### Syntax
`HLL_EMPTY(value)`
HLL_EMPTY returns a null value of type hll.
### example
```
MySQL > select hll_cardinality(hll_empty());
+------------------------------+
| hll_cardinality(hll_empty()) |
+------------------------------+
| 0 |
+------------------------------+
```
### keywords
HLL,HLL_EMPTY

View File

@ -0,0 +1,46 @@
---
{
"title": "HLL_HASH",
"language": "en"
}
---
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
## HLL_HASH
### description
#### Syntax
`HLL_HASH(value)`
HLL_HASH converts a value to hll type.
Typically used when loading data.
### example
```
MySQL > select HLL_CARDINALITY(HLL_HASH('abc'));
+----------------------------------+
| hll_cardinality(HLL_HASH('abc')) |
+----------------------------------+
| 1 |
+----------------------------------+
```
### keywords
HLL,HLL_HASH

View File

@ -558,6 +558,15 @@
"sql-manual/sql-functions/hash-functions/murmur_hash3_64"
]
},
{
"type": "category",
"label": "HLL Functions",
"items": [
"sql-manual/sql-functions/hll-functions/hll_cardinality",
"sql-manual/sql-functions/hll-functions/hll_empty",
"sql-manual/sql-functions/hll-functions/hll_hash"
]
},
{
"type": "category",
"label": "Math Functions",
@ -1120,4 +1129,4 @@
]
}
]
}
}

View File

@ -0,0 +1,45 @@
---
{
"title": "HLL_CARDINALITY",
"language": "zh-CN"
}
---
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
## HLL_CARDINALITY
### description
#### Syntax
`HLL_CARDINALITY(hll)`
HLL_CARDINALITY 用于计算 HLL 类型值的基数。
### example
```
MySQL > select HLL_CARDINALITY(uv_set) from test_uv;
+---------------------------+
| hll_cardinality(`uv_set`) |
+---------------------------+
| 3 |
+---------------------------+
```
### keywords
HLL,HLL_CARDINALITY

View File

@ -0,0 +1,45 @@
---
{
"title": "HLL_EMPTY",
"language": "zh-CN"
}
---
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
## HLL_EMPTY
### description
#### Syntax
`HLL_EMPTY(value)`
HLL_EMPTY 返回一个 hll 类型的空值。
### example
```
MySQL > select hll_cardinality(hll_empty());
+------------------------------+
| hll_cardinality(hll_empty()) |
+------------------------------+
| 0 |
+------------------------------+
```
### keywords
HLL,HLL_EMPTY

View File

@ -0,0 +1,45 @@
---
{
"title": "HLL_HASH",
"language": "zh-CN"
}
---
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
## HLL_HASH
### description
#### Syntax
`HLL_HASH(value)`
HLL_HASH 将一个值转换为 hll 类型。通常用于导入数据时,将普通类型的值导入到 hll 列中。
### example
```
MySQL > select HLL_CARDINALITY(HLL_HASH('abc'));
+----------------------------------+
| hll_cardinality(HLL_HASH('abc')) |
+----------------------------------+
| 1 |
+----------------------------------+
```
### keywords
HLL,HLL_HASH