diff --git a/docs/.vuepress/sidebar/en.js b/docs/.vuepress/sidebar/en.js index 56b9cbf91c2767..9a599bc2247ca2 100644 --- a/docs/.vuepress/sidebar/en.js +++ b/docs/.vuepress/sidebar/en.js @@ -502,7 +502,7 @@ module.exports = [ }, { title: "Encryption Functions", - directoryPath: "encrypt-dixgest-functions/", + directoryPath: "encrypt-digest-functions/", initialOpenGroupIndex: -1, children: [ "aes", @@ -524,7 +524,6 @@ module.exports = [ "outer-combinator" ], }, - "window-function", "cast", "digital-masking", ], diff --git a/docs/.vuepress/sidebar/zh-CN.js b/docs/.vuepress/sidebar/zh-CN.js index 878cbceeea3628..f2396b94d1c77e 100644 --- a/docs/.vuepress/sidebar/zh-CN.js +++ b/docs/.vuepress/sidebar/zh-CN.js @@ -502,7 +502,7 @@ module.exports = [ }, { title: "加密和信息摘要函数", - directoryPath: "encrypt-dixgest-functions/", + directoryPath: "encrypt-digest-functions/", initialOpenGroupIndex: -1, children: [ "aes", @@ -524,7 +524,6 @@ module.exports = [ "outer-combinator" ], }, - "window-function", "cast", "digital-masking", ], diff --git a/docs/en/get-starting/get-starting.md b/docs/en/get-starting/get-starting.md index 62e35871bbdf6a..06b4f1c77d3df6 100644 --- a/docs/en/get-starting/get-starting.md +++ b/docs/en/get-starting/get-starting.md @@ -151,7 +151,7 @@ Doris uses the MySQL protocol for communication, and users can connect to the Do By default, Http protocol is used for WebUI access, and the following format address is entered in the browser to access -```cql +``` http://FE_IP:FE_HTTP_PORT(默认8030) ``` @@ -688,4 +688,4 @@ The current UPDATE statement **only supports** row updates on the Unique model, ```sql DELETE FROM my_table PARTITIONS (p1, p2) WHERE k1 >= 3 AND k2 = "abc"; - ```` \ No newline at end of file + ```` diff --git a/docs/en/sql-manual/sql-functions/aggregate-functions/approx_count_distinct.md b/docs/en/sql-manual/sql-functions/aggregate-functions/approx_count_distinct.md index 0e73cc1f09d6c7..cad7c8110b8805 100644 --- a/docs/en/sql-manual/sql-functions/aggregate-functions/approx_count_distinct.md +++ b/docs/en/sql-manual/sql-functions/aggregate-functions/approx_count_distinct.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# APPROX_COUNT_DISTINCT -## Description -### Syntax +## APPROX_COUNT_DISTINCT +### Description +#### Syntax `APPROX_COUNT_DISTINCT (expr)` @@ -35,7 +35,7 @@ Returns an approximate aggregation function similar to the result of COUNT (DIST It combines COUNT and DISTINCT faster and uses fixed-size memory, so less memory can be used for columns with high cardinality. -## example +### example ``` MySQL > select approx_count_distinct(query_id) from log_statis group by datetime; +-----------------+ @@ -44,6 +44,6 @@ MySQL > select approx_count_distinct(query_id) from log_statis group by datetime | 17721 | +-----------------+ ``` -## keyword +### keywords APPROX_COUNT_DISTINCT diff --git a/docs/en/sql-manual/sql-functions/aggregate-functions/avg.md b/docs/en/sql-manual/sql-functions/aggregate-functions/avg.md index 25e9d09aeda5ad..4fdf1f188525e3 100644 --- a/docs/en/sql-manual/sql-functions/aggregate-functions/avg.md +++ b/docs/en/sql-manual/sql-functions/aggregate-functions/avg.md @@ -25,9 +25,9 @@ under the License. --> -#AVG -## Description -### Syntax +## AVG +### Description +#### Syntax `AVG([DISTINCT] expr)` @@ -36,7 +36,7 @@ Used to return the average value of the selected field Optional field DISTINCT parameters can be used to return the weighted average -## example +### example ``` mysql> SELECT datetime, AVG(cost_time) FROM log_statis group by datetime; @@ -54,6 +54,6 @@ mysql> SELECT datetime, AVG(distinct cost_time) FROM log_statis group by datetim +---------------------+---------------------------+ ``` -## keyword +### keywords AVG diff --git a/docs/en/sql-manual/sql-functions/aggregate-functions/bitmap_union.md b/docs/en/sql-manual/sql-functions/aggregate-functions/bitmap_union.md index ddffeb8ca27962..f5f0f890497bb3 100644 --- a/docs/en/sql-manual/sql-functions/aggregate-functions/bitmap_union.md +++ b/docs/en/sql-manual/sql-functions/aggregate-functions/bitmap_union.md @@ -25,9 +25,13 @@ under the License. --> -# BITMAP_UNION +## BITMAP_UNION -## Create table +### description + +### example + +#### Create table The aggregation model needs to be used when creating the table. The data type is bitmap and the aggregation function is bitmap_union. ``` @@ -47,7 +51,7 @@ Note: When the amount of data is large, it is best to create a corresponding rol ALTER TABLE pv_bitmap ADD ROLLUP pv (page, user_id); ``` -## Data Load +#### Data Load `TO_BITMAP (expr)`: Convert 0 ~ 18446744073709551615 unsigned bigint to bitmap @@ -55,7 +59,7 @@ ALTER TABLE pv_bitmap ADD ROLLUP pv (page, user_id); `BITMAP_HASH (expr)`: Convert any type of column to a bitmap by hashing -### Stream Load +##### Stream Load ``` cat data | curl --location-trusted -u user: passwd -T--H "columns: dt, page, user_id, user_id = to_bitmap (user_id)" http: // host: 8410 / api / test / testDb / _stream_load @@ -69,7 +73,7 @@ cat data | curl --location-trusted -u user: passwd -T--H "columns: dt, page, use cat data | curl --location-trusted -u user: passwd -T--H "columns: dt, page, user_id, user_id = bitmap_empty ()" http: // host: 8410 / api / test / testDb / _stream_load ``` -### Insert Into +##### Insert Into id2's column type is bitmap ``` @@ -97,9 +101,9 @@ insert into bitmap_table1 select id, bitmap_hash (id_string) from table; ``` -## Data Query +#### Data Query -### Syntax +##### Syntax `BITMAP_UNION (expr)`: Calculate the union of two Bitmaps. The return value is the new Bitmap value. @@ -112,7 +116,7 @@ insert into bitmap_table1 select id, bitmap_hash (id_string) from table; filter_column The cardinality of the intersection of multiple bitmaps of the filter. bitmap_column_to_count is a column of type bitmap, filter_column is a column of varying dimensions, and filter_values ​​is a list of dimension values. -### Example +##### Example The following SQL uses the pv_bitmap table above as an example: @@ -140,7 +144,6 @@ from pv_bitmap where page in ('meituan', 'waimai'); ``` - -## keyword +### keywords BITMAP, BITMAP_COUNT, BITMAP_EMPTY, BITMAP_UNION, BITMAP_UNION_INT, TO_BITMAP, BITMAP_UNION_COUNT, INTERSECT_COUNT diff --git a/docs/en/sql-manual/sql-functions/aggregate-functions/count.md b/docs/en/sql-manual/sql-functions/aggregate-functions/count.md index 2c3cb63cb67e84..70c2be3f69db4d 100644 --- a/docs/en/sql-manual/sql-functions/aggregate-functions/count.md +++ b/docs/en/sql-manual/sql-functions/aggregate-functions/count.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# COUNT -## Description -### Syntax +## COUNT +### Description +#### Syntax `COUNT([DISTINCT] expr)` Number of rows used to return the required rows -## example +### example ``` MySQL > select count(*) from log_statis group by datetime; @@ -57,5 +57,5 @@ MySQL > select count(distinct datetime) from log_statis group by datetime; | 71045 | +-------------------------------+ ``` -## keyword +### keywords COUNT diff --git a/docs/en/sql-manual/sql-functions/aggregate-functions/group_concat.md b/docs/en/sql-manual/sql-functions/aggregate-functions/group_concat.md index b9273a9fc18b55..8a092f6d159a4a 100644 --- a/docs/en/sql-manual/sql-functions/aggregate-functions/group_concat.md +++ b/docs/en/sql-manual/sql-functions/aggregate-functions/group_concat.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# group_concat -## description -### Syntax +## group_concat +### description +#### Syntax `VARCHAR GROUP_CONCAT(VARCHAR str[, VARCHAR sep])` This function is an aggregation function similar to sum (), and group_concat links multiple rows of results in the result set to a string. The second parameter, sep, is a connection symbol between strings, which can be omitted. This function usually needs to be used with group by statements. -## example +### example ``` mysql> select value from test; @@ -66,5 +66,5 @@ mysql> select GROUP_CONCAT(value, NULL) from test; | NULL | +----------------------------+ ``` -## keyword +### keywords GROUP_CONCAT,GROUP,CONCAT diff --git a/docs/en/sql-manual/sql-functions/aggregate-functions/hll_union_agg.md b/docs/en/sql-manual/sql-functions/aggregate-functions/hll_union_agg.md index 628d72dc6e9873..49d6da2d682b08 100644 --- a/docs/en/sql-manual/sql-functions/aggregate-functions/hll_union_agg.md +++ b/docs/en/sql-manual/sql-functions/aggregate-functions/hll_union_agg.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# HLL_UNION_AGG -## description -### Syntax +## HLL_UNION_AGG +### description +#### Syntax `HLL_UNION_AGG(hll)` @@ -39,7 +39,7 @@ Based on this, we get an estimate with an error of about 1%. The HLL column is g When importing, hll_hash function is used to specify which column in data is used to generate HLL column. It is often used to replace count distinct, and to calculate UV quickly in business by combining rollup. -## example +### example ``` MySQL > select HLL_UNION_AGG(uv_set) from test_uv;; +-------------------------+ @@ -48,5 +48,5 @@ THE COURT OF JUSTICE OF THE EUROPEAN COMMUNITIES, | 17721 | +-------------------------+ ``` -## keyword +### keywords HLL_UNION_AGG,HLL,UNION,AGG diff --git a/docs/en/sql-manual/sql-functions/aggregate-functions/max.md b/docs/en/sql-manual/sql-functions/aggregate-functions/max.md index 193de9adcd3bb2..68dd6183217c57 100644 --- a/docs/en/sql-manual/sql-functions/aggregate-functions/max.md +++ b/docs/en/sql-manual/sql-functions/aggregate-functions/max.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# MAX -## description -### Syntax +## MAX +### description +#### Syntax `MAX(expr)` Returns the maximum value of an expr expression -## example +### example ``` MySQL > select max(scan_rows) from log_statis group by datetime; +------------------+ @@ -42,5 +42,5 @@ MySQL > select max(scan_rows) from log_statis group by datetime; | 4671587 | +------------------+ ``` -## keyword +### keywords MAX diff --git a/docs/en/sql-manual/sql-functions/aggregate-functions/max_by.md b/docs/en/sql-manual/sql-functions/aggregate-functions/max_by.md index 27819f26d41159..df3096287e92bd 100644 --- a/docs/en/sql-manual/sql-functions/aggregate-functions/max_by.md +++ b/docs/en/sql-manual/sql-functions/aggregate-functions/max_by.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# MAX_BY -## description -### Syntax +## MAX_BY +### description +#### Syntax `MAX_BY(expr1, expr2)` Returns the value of an expr1 associated with the maximum value of expr2 in a group. -## example +### example ``` MySQL > select * from tbl; +------+------+------+------+ @@ -52,5 +52,5 @@ MySQL > select max_by(k1, k4) from tbl; | 0 | +--------------------+ ``` -## keyword +### keywords MAX_BY diff --git a/docs/en/sql-manual/sql-functions/aggregate-functions/min.md b/docs/en/sql-manual/sql-functions/aggregate-functions/min.md index 31506ff325205e..76915e2f1f1993 100644 --- a/docs/en/sql-manual/sql-functions/aggregate-functions/min.md +++ b/docs/en/sql-manual/sql-functions/aggregate-functions/min.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# MIN -## Description -### Syntax +## MIN +### Description +#### Syntax `MIN(expr)` Returns the minimum value of an expr expression -## example +### example ``` MySQL > select min(scan_rows) from log_statis group by datetime; +------------------+ @@ -42,5 +42,5 @@ MySQL > select min(scan_rows) from log_statis group by datetime; | 0 | +------------------+ ``` -## keyword +### keywords MIN diff --git a/docs/en/sql-manual/sql-functions/aggregate-functions/min_by.md b/docs/en/sql-manual/sql-functions/aggregate-functions/min_by.md index 98a3478cb426a6..52373088a4382b 100644 --- a/docs/en/sql-manual/sql-functions/aggregate-functions/min_by.md +++ b/docs/en/sql-manual/sql-functions/aggregate-functions/min_by.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# MIN_BY -## description -### Syntax +## MIN_BY +### description +#### Syntax `MIN_BY(expr1, expr2)` Returns the value of an expr1 associated with the minimum value of expr2 in a group. -## example +### example ``` MySQL > select * from tbl; +------+------+------+------+ @@ -52,5 +52,5 @@ MySQL > select min_by(k1, k4) from tbl; | 4 | +--------------------+ ``` -## keyword +### keywords MIN_BY diff --git a/docs/en/sql-manual/sql-functions/aggregate-functions/percentile.md b/docs/en/sql-manual/sql-functions/aggregate-functions/percentile.md index c22a4f54aa45b2..01851f03faabff 100644 --- a/docs/en/sql-manual/sql-functions/aggregate-functions/percentile.md +++ b/docs/en/sql-manual/sql-functions/aggregate-functions/percentile.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# PERCENTILE -## Description -### Syntax +## PERCENTILE +### Description +#### Syntax `PERCENTILE(expr, DOUBLE p)` @@ -36,7 +36,7 @@ Parameter Description: expr: required. The value is an integer (bigint at most). p: The exact percentile is required. The value is [0.0,1.0] -## example +### example ``` MySQL > select `table`, percentile(cost_time,0.99) from log_statis group by `table`; +---------------------+---------------------------+ @@ -54,5 +54,5 @@ MySQL > select percentile(NULL,0.3) from table1; ``` -## keyword +### keywords PERCENTILE diff --git a/docs/en/sql-manual/sql-functions/aggregate-functions/percentile_approx.md b/docs/en/sql-manual/sql-functions/aggregate-functions/percentile_approx.md index 85a3d8526ae575..627ebc09797a15 100644 --- a/docs/en/sql-manual/sql-functions/aggregate-functions/percentile_approx.md +++ b/docs/en/sql-manual/sql-functions/aggregate-functions/percentile_approx.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# PERCENTILE_APPROX -## Description -### Syntax +## PERCENTILE_APPROX +### Description +#### Syntax `PERCENTILE_APPROX(expr, DOUBLE p[, DOUBLE compression])` @@ -36,7 +36,7 @@ Compression param is optional and can be setted to a value in the range of [2048 This function uses fixed size memory, so less memory can be used for columns with high cardinality, and can be used to calculate statistics such as tp99. -## example +### example ``` MySQL > select `table`, percentile_approx(cost_time,0.99) from log_statis group by `table`; +---------------------+---------------------------+ @@ -52,5 +52,5 @@ MySQL > select `table`, percentile_approx(cost_time,0.99, 4096) from log_statis | test | 54.21 | +----------+--------------------------------------+ ``` -## keyword +### keywords PERCENTILE_APPROX,PERCENTILE,APPROX diff --git a/docs/en/sql-manual/sql-functions/aggregate-functions/stddev.md b/docs/en/sql-manual/sql-functions/aggregate-functions/stddev.md index 69e654fd6888bd..d22a6d771792ae 100644 --- a/docs/en/sql-manual/sql-functions/aggregate-functions/stddev.md +++ b/docs/en/sql-manual/sql-functions/aggregate-functions/stddev.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# STDDEV,STDDEV_POP -## Description -### Syntax +## STDDEV,STDDEV_POP +### Description +#### Syntax `stddev (expl)` Returns the standard deviation of the expr expression -## example +### example ``` MySQL > select stddev(scan_rows) from log_statis group by datetime; +---------------------+ @@ -49,5 +49,5 @@ MySQL > select stddev_pop(scan_rows) from log_statis group by datetime; | 2.3722760595994914 | +-------------------------+ ``` -## keyword +### keywords STDDEV,STDDEV_POP,POP diff --git a/docs/en/sql-manual/sql-functions/aggregate-functions/stddev_samp.md b/docs/en/sql-manual/sql-functions/aggregate-functions/stddev_samp.md index 177052d6a6edf0..086c7b4d841135 100644 --- a/docs/en/sql-manual/sql-functions/aggregate-functions/stddev_samp.md +++ b/docs/en/sql-manual/sql-functions/aggregate-functions/stddev_samp.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# STDDEV_SAMP -## Description -### Syntax +## STDDEV_SAMP +### Description +#### Syntax `STDDEV SAMP (expr)` Returns the sample standard deviation of the expr expression -## example +### example ``` MySQL > select stddev_samp(scan_rows) from log_statis group by datetime; +--------------------------+ @@ -42,5 +42,5 @@ MySQL > select stddev_samp(scan_rows) from log_statis group by datetime; | 2.372044195280762 | +--------------------------+ ``` -## keyword +### keywords STDDEV SAMP,STDDEV,SAMP diff --git a/docs/en/sql-manual/sql-functions/aggregate-functions/sum.md b/docs/en/sql-manual/sql-functions/aggregate-functions/sum.md index 42d10a42113135..10802b4707ae39 100644 --- a/docs/en/sql-manual/sql-functions/aggregate-functions/sum.md +++ b/docs/en/sql-manual/sql-functions/aggregate-functions/sum.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# SUM -## Description -### Syntax +## SUM +### Description +#### Syntax `Sum (Expr)` Used to return the sum of all values of the selected field -## example +### example ``` MySQL > select sum(scan_rows) from log_statis group by datetime; +------------------+ @@ -42,5 +42,5 @@ MySQL > select sum(scan_rows) from log_statis group by datetime; | 8217360135 | +------------------+ ``` -## keyword +### keywords SUM diff --git a/docs/en/sql-manual/sql-functions/aggregate-functions/topn.md b/docs/en/sql-manual/sql-functions/aggregate-functions/topn.md index 43967286f6d26e..8ca8840b445335 100644 --- a/docs/en/sql-manual/sql-functions/aggregate-functions/topn.md +++ b/docs/en/sql-manual/sql-functions/aggregate-functions/topn.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# TOPN -## description -### Syntax +## TOPN +### description +#### Syntax `topn(expr, INT top_num[, INT space_expand_rate])` @@ -39,7 +39,7 @@ counter numbers = top_num * space_expand_rate ``` The higher value of space_expand_rate, the more accurate result will be. The default value is 50 -## example +### example ``` MySQL [test]> select topn(keyword,10) from keyword_table where date>= '2020-06-01' and date <= '2020-06-19' ; +------------------------------------------------------------------------------------------------------------+ @@ -57,5 +57,5 @@ MySQL [test]> select date,topn(keyword,10,100) from keyword_table where date>= ' | 2020-06-17 | a:9, b:8, c:8, j:8, d:7, e:7, f:7, h:7, i:7, k:7 | +------------+-----------------------------------------------------------------------------------------------+ ``` -## keyword +### keywords TOPN \ No newline at end of file diff --git a/docs/en/sql-manual/sql-functions/aggregate-functions/var_samp.md b/docs/en/sql-manual/sql-functions/aggregate-functions/var_samp.md index fa10810e022abb..8fe7ad5a39f7ec 100644 --- a/docs/en/sql-manual/sql-functions/aggregate-functions/var_samp.md +++ b/docs/en/sql-manual/sql-functions/aggregate-functions/var_samp.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# VARIANCE_SAMP,VARIANCE_SAMP -## Description -### Syntax +## VARIANCE_SAMP,VARIANCE_SAMP +### Description +#### Syntax `VAR SAMP (expr)` Returns the sample variance of the expr expression -## example +### example ``` MySQL > select var_samp(scan_rows) from log_statis group by datetime; +-----------------------+ @@ -42,5 +42,5 @@ MySQL > select var_samp(scan_rows) from log_statis group by datetime; | 5.6227132145741789 | +-----------------------+ ``` -## keyword +### keywords VAR SAMP, VARIANCE SAMP,VAR,SAMP,VARIANCE diff --git a/docs/en/sql-manual/sql-functions/aggregate-functions/variance.md b/docs/en/sql-manual/sql-functions/aggregate-functions/variance.md index e83528739edd12..f58da61bf708f7 100644 --- a/docs/en/sql-manual/sql-functions/aggregate-functions/variance.md +++ b/docs/en/sql-manual/sql-functions/aggregate-functions/variance.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# VARIANCE,VAR_POP,VARIANCE_POP -## Description -### Syntax +## VARIANCE,VAR_POP,VARIANCE_POP +### Description +#### Syntax `VARIANCE(expr)` Returns the variance of the expr expression -## example +### example ``` MySQL > select variance(scan_rows) from log_statis group by datetime; +-----------------------+ @@ -49,5 +49,5 @@ MySQL > select var_pop(scan_rows) from log_statis group by datetime; | 5.6230744719006163 | +----------------------+ ``` -## keyword +### keywords VARIANCE,VAR_POP,VARIANCE_POP,VAR,POP diff --git a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_and.md b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_and.md index 73c291309b3d88..a64a52b57053cd 100644 --- a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_and.md +++ b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_and.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# bitmap_and -## description -### Syntax +## bitmap_and +### description +#### Syntax `BITMAP BITMAP_AND(BITMAP lhs, BITMAP rhs, ...)` Compute intersection of two or more input bitmaps, return the new bitmap. -## example +### example ``` mysql> select bitmap_count(bitmap_and(to_bitmap(1), to_bitmap(2))) cnt; @@ -78,6 +78,6 @@ MySQL> select bitmap_to_string(bitmap_and(bitmap_from_string('1,2,3'), bitmap_fr +-----------------------------------------------------------------------------------------------------------------------------+ ``` -## keyword +### keywords BITMAP_AND,BITMAP diff --git a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_and_count.md b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_and_count.md index 84c30c8eda7f99..ca23c4abe30d33 100644 --- a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_and_count.md +++ b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_and_count.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# bitmap_and_count -## description -### Syntax +## bitmap_and_count +### description +#### Syntax `BigIntVal bitmap_and_count(BITMAP lhs, BITMAP rhs, ...)` Calculate the intersection of two or more input bitmaps and return the number of intersections. -## example +### example ``` MySQL> select bitmap_and_count(bitmap_from_string('1,2,3'),bitmap_empty()); @@ -79,6 +79,6 @@ MySQL> select bitmap_and_count(bitmap_from_string('1,2,3'), bitmap_from_string(' +-------------------------------------------------------------------------------------------------------------------+ ``` -## keyword +### keywords BITMAP_AND_COUNT,BITMAP diff --git a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_and_not.md b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_and_not.md index 2f11d4b2484ab2..e370ce90b31c90 100644 --- a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_and_not.md +++ b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_and_not.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# bitmap_and_not -## description -### Syntax +## bitmap_and_not +### description +#### Syntax `BITMAP BITMAP_AND_NOT(BITMAP lhs, BITMAP rhs)` Calculate the set after lhs minus intersection of two input bitmaps, return the new bitmap. -## example +### example ``` mysql> select bitmap_count(bitmap_and_not(bitmap_from_string('1,2,3'),bitmap_from_string('3,4,5'))) cnt; @@ -43,6 +43,6 @@ mysql> select bitmap_count(bitmap_and_not(bitmap_from_string('1,2,3'),bitmap_fro +------+ ``` -## keyword +### keywords BITMAP_AND_NOT,BITMAP diff --git a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_and_not_count.md b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_and_not_count.md index af33d0915de7da..daf9ab5e842d32 100644 --- a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_and_not_count.md +++ b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_and_not_count.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# bitmap_and_not_count -## description -### Syntax +## bitmap_and_not_count +### description +#### Syntax `BITMAP BITMAP_AND_NOT_COUNT(BITMAP lhs, BITMAP rhs)` Calculate the set after lhs minus intersection of two input bitmaps, return the new bitmap size. -## example +### example ``` mysql> select bitmap_and_not_count(bitmap_from_string('1,2,3'),bitmap_from_string('3,4,5')) cnt; @@ -44,6 +44,6 @@ mysql> select bitmap_and_not_count(bitmap_from_string('1,2,3'),bitmap_from_strin +------+ ``` -## keyword +### keywords BITMAP_AND_NOT_COUNT,BITMAP diff --git a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_contains.md b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_contains.md index 5537ddbc0758a9..0b2f7061877d36 100644 --- a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_contains.md +++ b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_contains.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# bitmap_contains -## description -### Syntax +## bitmap_contains +### description +#### Syntax `B00LEAN BITMAP_CONTAINS(BITMAP bitmap, BIGINT input)` Calculates whether the input value is in the Bitmap column and returns a Boolean value. -## example +### example ``` mysql> select bitmap_contains(to_bitmap(1),2) cnt; @@ -50,6 +50,6 @@ mysql> select bitmap_contains(to_bitmap(1),1) cnt; +------+ ``` -## keyword +### keywords BITMAP_CONTAINS,BITMAP diff --git a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_empty.md b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_empty.md index 0b332335e2d082..6c5a90cceac17e 100644 --- a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_empty.md +++ b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_empty.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# bitmap_empty -## description -### Syntax +## bitmap_empty +### description +#### Syntax `BITMAP BITMAP_EMPTY()` @@ -36,7 +36,7 @@ Return an empty bitmap. Mainly be used to supply default value for bitmap column cat data | curl --location-trusted -u user:passwd -T - -H "columns: dt,page,v1,v2=bitmap_empty()" http://host:8410/api/test/testDb/_stream_load ``` -## example +### example ``` mysql> select bitmap_count(bitmap_empty()); @@ -47,6 +47,6 @@ mysql> select bitmap_count(bitmap_empty()); +------------------------------+ ``` -## keyword +### keywords BITMAP_EMPTY,BITMAP diff --git a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_from_string.md b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_from_string.md index 2dc75c3d43bcda..0d2f71c74f7b4e 100644 --- a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_from_string.md +++ b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_from_string.md @@ -22,10 +22,10 @@ specific language governing permissions and limitations under the License. --> -# bitmap_from_string +## bitmap_from_string -## description -### Syntax +### description +#### Syntax `BITMAP BITMAP_FROM_STRING(VARCHAR input)` @@ -33,7 +33,7 @@ Convert a string into a bitmap. The input string should be a comma separated UNI For example: input string "0, 1, 2" will be converted to a Bitmap with bit 0, 1, 2 set. If input string is invalid, return NULL. -## example +### example ``` mysql> select bitmap_to_string(bitmap_empty()); @@ -58,6 +58,6 @@ mysql> select bitmap_from_string("-1, 0, 1, 2"); +-----------------------------------+ ``` -## keyword +### keywords BITMAP_FROM_STRING,BITMAP diff --git a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_has_all.md b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_has_all.md index e8eb6e15f01241..a170cb5df52392 100644 --- a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_has_all.md +++ b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_has_all.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# bitmap_has_all -## description -### Syntax +## bitmap_has_all +### description +#### Syntax `B00LEAN BITMAP_HAS_ALL(BITMAP lhs, BITMAP rhs)` Returns true if the first bitmap contains all the elements of the second bitmap. Returns true if the second bitmap contains an empty element. -## example +### example ``` mysql> select bitmap_has_all(bitmap_from_string("0, 1, 2"), bitmap_from_string("1, 2")) cnt; @@ -51,6 +51,6 @@ mysql> select bitmap_has_all(bitmap_empty(), bitmap_from_string("1, 2")) cnt; +------+ ``` -## keyword +### keywords BITMAP_HAS_ALL,BITMAP diff --git a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_has_any.md b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_has_any.md index 8138c467b85322..31bb8dd479c1d0 100644 --- a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_has_any.md +++ b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_has_any.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# bitmap_has_any -## description -### Syntax +## bitmap_has_any +### description +#### Syntax `B00LEAN BITMAP_HAS_ANY(BITMAP lhs, BITMAP rhs)` Calculate whether there are intersecting elements in the two Bitmap columns. The return value is Boolean. -## example +### example ``` mysql> select bitmap_has_any(to_bitmap(1),to_bitmap(2)) cnt; @@ -50,6 +50,6 @@ mysql> select bitmap_has_any(to_bitmap(1),to_bitmap(1)) cnt; +------+ ``` -## keyword +### keywords BITMAP_HAS_ANY,BITMAP diff --git a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_hash.md b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_hash.md index ff3ed8b66c900b..1b19f5a07c8fcb 100644 --- a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_hash.md +++ b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_hash.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# bitmap_hash -## description -### Syntax +## bitmap_hash +### description +#### Syntax `BITMAP BITMAP_HASH(expr)` @@ -36,7 +36,7 @@ Compute the 32-bits hash value of a expr of any type, then return a bitmap conta cat data | curl --location-trusted -u user:passwd -T - -H "columns: dt,page,device_id, device_id=bitmap_hash(device_id)" http://host:8410/api/test/testDb/_stream_load ``` -## example +### example ``` mysql> select bitmap_count(bitmap_hash('hello')); @@ -47,6 +47,6 @@ mysql> select bitmap_count(bitmap_hash('hello')); +------------------------------------+ ``` -## keyword +### keywords BITMAP_HASH,BITMAP diff --git a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_intersect.md b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_intersect.md index 374441a3bff783..2281bb3325b8a7 100644 --- a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_intersect.md +++ b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_intersect.md @@ -24,18 +24,18 @@ specific language governing permissions and limitations under the License. --> -# bitmap_intersect -## description +## bitmap_intersect +### description Aggregation function, used to calculate the bitmap intersection after grouping. Common usage scenarios such as: calculating user retention rate. -### Syntax +#### Syntax `BITMAP BITMAP_INTERSECT(BITMAP value)` Enter a set of bitmap values, find the intersection of the set of bitmap values, and return. -## example +### example Table schema @@ -56,6 +56,6 @@ Who are the users retained under different tags between 2020-05-18 and 2020-05-1 mysql> select tag, bitmap_to_string(bitmap_intersect(user_id)) from (select tag, date, bitmap_union(user_id) user_id from table where date in ('2020-05-18', '2020-05-19') group by tag, date) a group by tag; ``` -## keyword +### keywords BITMAP_INTERSECT, BITMAP diff --git a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_max.md b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_max.md index 9edff1aa65484b..3ecda9780a7042 100644 --- a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_max.md +++ b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_max.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# bitmap_max -## description -### Syntax +## bitmap_max +### description +#### Syntax `BIGINT BITMAP_MAX(BITMAP input)` Calculate and return the max values of a bitmap. -## example +### example ``` mysql> select bitmap_max(bitmap_from_string('')) value; @@ -50,6 +50,6 @@ mysql> select bitmap_max(bitmap_from_string('1,9999999999')) value; +------------+ ``` -## keyword +### keywords BITMAP_MAX,BITMAP diff --git a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_min.md b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_min.md index 484f8158f5fcf7..89a4f4104f19c8 100644 --- a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_min.md +++ b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_min.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# bitmap_min -## description -### Syntax +## bitmap_min +### description +#### Syntax `BIGINT BITMAP_MIN(BITMAP input)` Calculate and return the min values of a bitmap. -## example +### example ``` mysql> select bitmap_min(bitmap_from_string('')) value; @@ -50,6 +50,6 @@ mysql> select bitmap_min(bitmap_from_string('1,9999999999')) value; +-------+ ``` -## keyword +### keywords BITMAP_MIN,BITMAP diff --git a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_not.md b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_not.md index 9ec99383edccb9..4d262480917afa 100644 --- a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_not.md +++ b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_not.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# bitmap_not -## description -### Syntax +## bitmap_not +### description +#### Syntax `BITMAP BITMAP_NOT(BITMAP lhs, BITMAP rhs)` Calculate the set after lhs minus rhs, return the new bitmap. -## example +### example ``` mysql> select bitmap_count(bitmap_not(bitmap_from_string('2,3'),bitmap_from_string('1,2,3,4'))) cnt; @@ -50,6 +50,6 @@ mysql> select bitmap_to_string(bitmap_not(bitmap_from_string('2,3,5'),bitmap_fro +----------------------------------------------------------------------------------------+ ``` -## keyword +### keywords BITMAP_NOT,BITMAP diff --git a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_or.md b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_or.md index e720bb0ef4be60..e5e9be9ac69ff7 100644 --- a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_or.md +++ b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_or.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# bitmap_or -## description -### Syntax +## bitmap_or +### description +#### Syntax `BITMAP BITMAP_OR(BITMAP lhs, BITMAP rhs, ...)` Compute union of two or more input bitmaps, returns the new bitmap. -## example +### example ``` mysql> select bitmap_count(bitmap_or(to_bitmap(1), to_bitmap(2))) cnt; @@ -78,6 +78,6 @@ MySQL> select bitmap_to_string(bitmap_or(to_bitmap(10), bitmap_from_string('1,2' +--------------------------------------------------------------------------------------------------------+ ``` -## keyword +### keywords BITMAP_OR,BITMAP diff --git a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_or_count.md b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_or_count.md index b3230d364050c9..cfbcc400438216 100644 --- a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_or_count.md +++ b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_or_count.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# bitmap_or_count -## description -### Syntax +## bitmap_or_count +### description +#### Syntax `BigIntVal bitmap_or_count(BITMAP lhs, BITMAP rhs)` Calculates the union of two or more input bitmaps and returns the number of union sets. -## example +### example ``` MySQL> select bitmap_or_count(bitmap_from_string('1,2,3'),bitmap_empty()); @@ -72,6 +72,6 @@ MySQL> select bitmap_or_count(bitmap_from_string('1,2,3'), bitmap_from_string('3 +-------------------------------------------------------------------------------------------------+ ``` -## keyword +### keywords BITMAP_OR_COUNT,BITMAP diff --git a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_subset_in_range.md b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_subset_in_range.md index c72d65216f7906..878494f840893f 100644 --- a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_subset_in_range.md +++ b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_subset_in_range.md @@ -24,17 +24,17 @@ specific language governing permissions and limitations under the License. --> -# bitmap_subset_in_range +## bitmap_subset_in_range -## Description +### Description -### Syntax +#### Syntax `BITMAP BITMAP_SUBSET_IN_RANGE(BITMAP src, BIGINT range_start, BIGINT range_end)` Return subset in specified range (not include the range_end). -## example +### example ``` mysql> select bitmap_to_string(bitmap_subset_in_range(bitmap_from_string('1,2,3,4,5'), 0, 9)) value; @@ -52,6 +52,6 @@ mysql> select bitmap_to_string(bitmap_subset_in_range(bitmap_from_string('1,2,3, +-------+ ``` -## keyword +### keywords BITMAP_SUBSET_IN_RANGE,BITMAP_SUBSET,BITMAP diff --git a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_subset_limit.md b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_subset_limit.md index 5c641b4afc30aa..74a39a477f7995 100644 --- a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_subset_limit.md +++ b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_subset_limit.md @@ -24,11 +24,11 @@ specific language governing permissions and limitations under the License. --> -# bitmap_subset_limit +## bitmap_subset_limit -## Description +### Description -### Syntax +#### Syntax `BITMAP BITMAP_SUBSET_LIMIT(BITMAP src, BIGINT range_start, BIGINT cardinality_limit)` @@ -36,7 +36,7 @@ Create subset of the BITMAP, begin with range from range_start, limit by cardina range_start: start value for the range cardinality_limit: subset upper limit -## example +### example ``` mysql> select bitmap_to_string(bitmap_subset_limit(bitmap_from_string('1,2,3,4,5'), 0, 3)) value; @@ -54,6 +54,6 @@ mysql> select bitmap_to_string(bitmap_subset_limit(bitmap_from_string('1,2,3,4,5 +-------+ ``` -## keyword +### keywords BITMAP_SUBSET_LIMIT,BITMAP_SUBSET,BITMAP diff --git a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_to_string.md b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_to_string.md index c9f551011f99cf..d80717c5b1212b 100644 --- a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_to_string.md +++ b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_to_string.md @@ -22,17 +22,17 @@ specific language governing permissions and limitations under the License. --> -# bitmap_to_string +## bitmap_to_string -## description -### Syntax +### description +#### Syntax `VARCHAR BITMAP_TO_STRING(BITMAP input)` Convert a input BITMAP to a string. The string is a separated string, contains all set bits in Bitmap. If input is null, return null. -## example +### example ``` mysql> select bitmap_to_string(null); @@ -65,6 +65,6 @@ mysql> select bitmap_to_string(bitmap_or(to_bitmap(1), to_bitmap(2))); ``` -## keyword +### keywords BITMAP_TO_STRING,BITMAP diff --git a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_union.md b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_union.md index bf4740829f31e3..b93a33c25ac472 100644 --- a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_union.md +++ b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_union.md @@ -24,19 +24,19 @@ specific language governing permissions and limitations under the License. --> -# bitmap_union function +## bitmap_union function -## description +### description Aggregate function, used to calculate the grouped bitmap union. Common usage scenarios such as: calculating PV, UV. -### Syntax +#### Syntax `BITMAP BITMAP_UNION(BITMAP value)` Enter a set of bitmap values, find the union of this set of bitmap values, and return. -## example +### example ``` mysql> select page_id, bitmap_union(user_id) from table group by page_id; @@ -54,6 +54,6 @@ When the user_id field is int, the above query semantics is equivalent to mysql> select page_id, count(distinct user_id) from table group by page_id; ``` -## keyword +### keywords BITMAP_UNION, BITMAP diff --git a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_xor.md b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_xor.md index 815358e9f3d349..e602ac3ce78a75 100644 --- a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_xor.md +++ b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_xor.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# bitmap_xor -## description -### Syntax +## bitmap_xor +### description +#### Syntax `BITMAP BITMAP_XOR(BITMAP lhs, BITMAP rhs, ...)` Compute the symmetric union of two or more input bitmaps, return the new bitmap. -## example +### example ``` mysql> select bitmap_count(bitmap_xor(bitmap_from_string('2,3'),bitmap_from_string('1,2,3,4'))) cnt; @@ -71,6 +71,6 @@ MySQL> select bitmap_to_string(bitmap_xor(bitmap_from_string('2,3'),bitmap_from_ +---------------------------------------------------------------------------------------------------------------------------+ ``` -## keyword +### keywords BITMAP_XOR,BITMAP diff --git a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_xor_count.md b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_xor_count.md index ad73ea13fcb75d..7d096f097b0bf9 100644 --- a/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_xor_count.md +++ b/docs/en/sql-manual/sql-functions/bitmap-functions/bitmap_xor_count.md @@ -22,17 +22,17 @@ specific language governing permissions and limitations under the License. --> -# bitmap_xor_count +## bitmap_xor_count -## description +### description -### Syntax +#### Syntax `BIGINT BITMAP_XOR_COUNT(BITMAP lhs, BITMAP rhs, ...)` XOR two or more bitmap sets and return the size of the result set. -## example +### example ``` mysql> select bitmap_xor_count(bitmap_from_string('1,2,3'),bitmap_from_string('3,4,5')); @@ -78,6 +78,6 @@ MySQL> select (bitmap_xor_count(bitmap_from_string('2,3'),bitmap_from_string('1, +-----------------------------------------------------------------------------------------------------------------+ ``` -## keyword +### keywords BITMAP_XOR_COUNT,BITMAP diff --git a/docs/en/sql-manual/sql-functions/bitmap-functions/orthogonal_bitmap_intersect.md b/docs/en/sql-manual/sql-functions/bitmap-functions/orthogonal_bitmap_intersect.md index 287df98f3a7b61..d247c48590869a 100644 --- a/docs/en/sql-manual/sql-functions/bitmap-functions/orthogonal_bitmap_intersect.md +++ b/docs/en/sql-manual/sql-functions/bitmap-functions/orthogonal_bitmap_intersect.md @@ -22,14 +22,14 @@ specific language governing permissions and limitations under the License. --> -# orthogonal_bitmap_intersect -## description -### Syntax +## orthogonal_bitmap_intersect +### description +#### Syntax `BITMAP ORTHOGONAL_BITMAP_INTERSECT(bitmap_column, column_to_filter, filter_values)` The bitmap intersection function, the first parameter is the bitmap column, the second parameter is the dimension column for filtering, and the third parameter is the variable length parameter, which means different values of the filter dimension column -## example +### example ``` mysql> select orthogonal_bitmap_intersect(members, tag_group, 1150000, 1150001, 390006) from tag_map where tag_group in ( 1150000, 1150001, 390006); @@ -42,6 +42,6 @@ mysql> select orthogonal_bitmap_intersect(members, tag_group, 1150000, 1150001, ``` -## keyword +### keywords ORTHOGONAL_BITMAP_INTERSECT,BITMAP diff --git a/docs/en/sql-manual/sql-functions/bitmap-functions/orthogonal_bitmap_intersect_count.md b/docs/en/sql-manual/sql-functions/bitmap-functions/orthogonal_bitmap_intersect_count.md index 48f6a5f462264d..fcf59221897551 100644 --- a/docs/en/sql-manual/sql-functions/bitmap-functions/orthogonal_bitmap_intersect_count.md +++ b/docs/en/sql-manual/sql-functions/bitmap-functions/orthogonal_bitmap_intersect_count.md @@ -22,14 +22,14 @@ specific language governing permissions and limitations under the License. --> -# orthogonal_bitmap_intersect_count -## description -### Syntax +## orthogonal_bitmap_intersect_count +### description +#### Syntax `BITMAP ORTHOGONAL_BITMAP_INTERSECT_COUNT(bitmap_column, column_to_filter, filter_values)` The bitmap intersection count function, the first parameter is the bitmap column, the second parameter is the dimension column for filtering, and the third parameter is the variable length parameter, which means different values of the filter dimension column -## example +### example ``` mysql> select orthogonal_bitmap_intersect_count(members, tag_group, 1150000, 1150001, 390006) from tag_map where tag_group in ( 1150000, 1150001, 390006); @@ -41,6 +41,6 @@ mysql> select orthogonal_bitmap_intersect_count(members, tag_group, 1150000, 115 1 row in set (3.382 sec) ``` -## keyword +### keywords ORTHOGONAL_BITMAP_INTERSECT_COUNT,BITMAP diff --git a/docs/en/sql-manual/sql-functions/bitmap-functions/orthogonal_bitmap_union_count.md b/docs/en/sql-manual/sql-functions/bitmap-functions/orthogonal_bitmap_union_count.md index 08d3769be05377..306d875b1b6662 100644 --- a/docs/en/sql-manual/sql-functions/bitmap-functions/orthogonal_bitmap_union_count.md +++ b/docs/en/sql-manual/sql-functions/bitmap-functions/orthogonal_bitmap_union_count.md @@ -22,14 +22,14 @@ specific language governing permissions and limitations under the License. --> -# orthogonal_bitmap_union_count -## description -### Syntax +## orthogonal_bitmap_union_count +### description +#### Syntax `BITMAP ORTHOGONAL_BITMAP_UNION_COUNT(bitmap_column, column_to_filter, filter_values)` Figure out the bitmap union count function, syntax with the original bitmap_union_count, but the implementation is different. -## example +### example ``` mysql> select orthogonal_bitmap_union_count(members) from tag_map where tag_group in ( 1150000, 1150001, 390006); @@ -41,6 +41,6 @@ mysql> select orthogonal_bitmap_union_count(members) from tag_map where tag_gro 1 row in set (2.645 sec) ``` -## keyword +### keywords ORTHOGONAL_BITMAP_UNION_COUNT,BITMAP \ No newline at end of file diff --git a/docs/en/sql-manual/sql-functions/bitmap-functions/sub_bitmap.md b/docs/en/sql-manual/sql-functions/bitmap-functions/sub_bitmap.md index eb4aeaea9b6cf3..b135b25aa1ebd7 100644 --- a/docs/en/sql-manual/sql-functions/bitmap-functions/sub_bitmap.md +++ b/docs/en/sql-manual/sql-functions/bitmap-functions/sub_bitmap.md @@ -22,16 +22,16 @@ specific language governing permissions and limitations under the License. --> -# sub_bitmap +## sub_bitmap -## description -### Syntax +### description +#### Syntax `BITMAP SUB_BITMAP(BITMAP src, BIGINT offset, BIGINT cardinality_limit)` Starting from the position specified by offset, intercept cardinality_limit bitmap elements and return a bitmap subset. -## example +### example ``` mysql> select bitmap_to_string(sub_bitmap(bitmap_from_string('1,0,1,2,3,1,5'), 0, 3)) value; @@ -56,6 +56,6 @@ mysql> select bitmap_to_string(sub_bitmap(bitmap_from_string('1,0,1,2,3,1,5'), 2 +-------+ ``` -## keyword +### keywords SUB_BITMAP,BITMAP_SUBSET,BITMAP diff --git a/docs/en/sql-manual/sql-functions/bitmap-functions/to_bitmap.md b/docs/en/sql-manual/sql-functions/bitmap-functions/to_bitmap.md index a2ea7903d7bcf4..ea0e8bbdeee54b 100644 --- a/docs/en/sql-manual/sql-functions/bitmap-functions/to_bitmap.md +++ b/docs/en/sql-manual/sql-functions/bitmap-functions/to_bitmap.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# to_bitmap -## description -### Syntax +## to_bitmap +### description +#### Syntax `BITMAP TO_BITMAP(expr)` @@ -38,7 +38,7 @@ Mainly be used to load integer value into bitmap column, e.g., cat data | curl --location-trusted -u user:passwd -T - -H "columns: dt,page,user_id, user_id=to_bitmap(user_id)" http://host:8410/api/test/testDb/_stream_load ``` -## example +### example ``` mysql> select bitmap_count(to_bitmap(10)); @@ -56,6 +56,6 @@ MySQL> select bitmap_to_string(to_bitmap(-1)); +---------------------------------+ ``` -## keyword +### keywords TO_BITMAP,BITMAP diff --git a/docs/en/sql-manual/sql-functions/bitwise-functions/bitand.md b/docs/en/sql-manual/sql-functions/bitwise-functions/bitand.md index 07eae1e8f7f8cb..8a3429c870d72a 100644 --- a/docs/en/sql-manual/sql-functions/bitwise-functions/bitand.md +++ b/docs/en/sql-manual/sql-functions/bitwise-functions/bitand.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# bitand -## description -### Syntax +## bitand +### description +#### Syntax `BITAND(Integer-type lhs, Integer-type rhs)` @@ -34,7 +34,7 @@ Returns the result of the AND operation of two integers. Integer range: TINYINT、SMALLINT、INT、BIGINT、LARGEINT -## example +### example ``` mysql> select bitand(3,5) ans; @@ -52,6 +52,6 @@ mysql> select bitand(4,7) ans; +------+ ``` -## keyword +### keywords BITAND diff --git a/docs/en/sql-manual/sql-functions/bitwise-functions/bitnot.md b/docs/en/sql-manual/sql-functions/bitwise-functions/bitnot.md index 458011aa188e6f..dd2452cf31cc8f 100644 --- a/docs/en/sql-manual/sql-functions/bitwise-functions/bitnot.md +++ b/docs/en/sql-manual/sql-functions/bitwise-functions/bitnot.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# bitnot -## description -### Syntax +## bitnot +### description +#### Syntax `BITNOT(Integer-type value)` @@ -34,7 +34,7 @@ Returns the result of the NOT operation of one integer. Integer range: TINYINT、SMALLINT、INT、BIGINT、LARGEINT -## example +### example ``` mysql> select bitnot(7) ans; @@ -52,6 +52,6 @@ mysql> select bitxor(-127) ans; +------+ ``` -## keyword +### keywords BITNOT diff --git a/docs/en/sql-manual/sql-functions/bitwise-functions/bitor.md b/docs/en/sql-manual/sql-functions/bitwise-functions/bitor.md index 8c2d1c63830827..46580e397f0cf0 100644 --- a/docs/en/sql-manual/sql-functions/bitwise-functions/bitor.md +++ b/docs/en/sql-manual/sql-functions/bitwise-functions/bitor.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# bitor -## description -### Syntax +## bitor +### description +#### Syntax `BITOR(Integer-type lhs, Integer-type rhs)` @@ -34,7 +34,7 @@ Returns the result of the OR operation of two integers. Integer range: TINYINT、SMALLINT、INT、BIGINT、LARGEINT -## example +### example ``` mysql> select bitor(3,5) ans; @@ -52,6 +52,6 @@ mysql> select bitand(4,7) ans; +------+ ``` -## keyword +### keywords BITOR diff --git a/docs/en/sql-manual/sql-functions/bitwise-functions/bitxor.md b/docs/en/sql-manual/sql-functions/bitwise-functions/bitxor.md index 849db173d60600..0f241da13fc4d1 100644 --- a/docs/en/sql-manual/sql-functions/bitwise-functions/bitxor.md +++ b/docs/en/sql-manual/sql-functions/bitwise-functions/bitxor.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# bitxor -## description -### Syntax +## bitxor +### description +#### Syntax `BITXOR(Integer-type lhs, Integer-type rhs)` @@ -34,7 +34,7 @@ Returns the result of the XOR operation of two integers. Integer range: TINYINT、SMALLINT、INT、BIGINT、LARGEINT -## example +### example ``` mysql> select bitxor(3,5) ans; @@ -52,6 +52,6 @@ mysql> select bitxor(1,7) ans; +------+ ``` -## keyword +### keywords BITXOR diff --git a/docs/en/sql-manual/sql-functions/cast.md b/docs/en/sql-manual/sql-functions/cast.md index 4155e589fee11a..c9752966469709 100644 --- a/docs/en/sql-manual/sql-functions/cast.md +++ b/docs/en/sql-manual/sql-functions/cast.md @@ -24,18 +24,17 @@ specific language governing permissions and limitations under the License. --> - -# CAST -##Description +## CAST +### Description ``` cast (input as type) ``` -### BIGINT type +#### BIGINT type -### Syntax (BIGINT) +#### Syntax (BIGINT) ``` cast (input as BIGINT) ``` @@ -45,7 +44,7 @@ Converts input to the specified type Converting the current column input to BIGINT type -## example +### example 1. Turn constant, or a column in a table @@ -79,5 +78,5 @@ mysql> select cast(cast ("11.2" as double) as bigint); +----------------------------------------+ 1 row in set (0.00 sec) ``` -## keyword +### keywords CAST diff --git a/docs/en/sql-manual/sql-functions/conditional-functions/case.md b/docs/en/sql-manual/sql-functions/conditional-functions/case.md index 846140f4baf50b..a678b25567f7c2 100644 --- a/docs/en/sql-manual/sql-functions/conditional-functions/case.md +++ b/docs/en/sql-manual/sql-functions/conditional-functions/case.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# case -## description -### Syntax +## case +### description +#### Syntax ``` CASE expression @@ -49,7 +49,7 @@ END Compare the expression with multiple possible values, and return the corresponding results when matching -## example +### example ``` mysql> select user_id, case user_id when 1 then 'user_id = 1' when 2 then 'user_id = 2' else 'user_id not exist' end test_case from test; @@ -68,5 +68,5 @@ mysql> select user_id, case when user_id = 1 then 'user_id = 1' when user_id = 2 | 2 | user_id = 2 | +---------+-------------+ ``` -## keyword +### keywords CASE diff --git a/docs/en/sql-manual/sql-functions/conditional-functions/coalesce.md b/docs/en/sql-manual/sql-functions/conditional-functions/coalesce.md index b3073e54ebb792..10a090b9537185 100644 --- a/docs/en/sql-manual/sql-functions/conditional-functions/coalesce.md +++ b/docs/en/sql-manual/sql-functions/conditional-functions/coalesce.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# coalesce -## description -### Syntax +## coalesce +### description +#### Syntax `coalesce(expr1, expr2, ...., expr_n)` Returns the first non empty expression in the parameter (from left to right) -## example +### example ``` mysql> select coalesce(NULL, '1111', '0000'); @@ -43,5 +43,5 @@ mysql> select coalesce(NULL, '1111', '0000'); | 1111 | +--------------------------------+ ``` -## keyword +### keywords COALESCE diff --git a/docs/en/sql-manual/sql-functions/conditional-functions/if.md b/docs/en/sql-manual/sql-functions/conditional-functions/if.md index 82b66cfa617ff7..292fc7177f035f 100644 --- a/docs/en/sql-manual/sql-functions/conditional-functions/if.md +++ b/docs/en/sql-manual/sql-functions/conditional-functions/if.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# if -## description -### Syntax +## if +### description +#### Syntax `if(boolean condition, type valueTrue, type valueFalseOrNull)` @@ -35,7 +35,7 @@ Returns valueTrue when condition is true, returns valueFalseOrNull otherwise. The return type is the type of the result of the valueTrue/valueFalseOrNull expression -## example +### example ``` mysql> select user_id, if(user_id = 1, "true", "false") test_if from test; @@ -46,5 +46,5 @@ mysql> select user_id, if(user_id = 1, "true", "false") test_if from test; | 2 | false | +---------+---------+ ``` -## keyword +### keywords IF diff --git a/docs/en/sql-manual/sql-functions/conditional-functions/ifnull.md b/docs/en/sql-manual/sql-functions/conditional-functions/ifnull.md index 7d22efb7f96d2d..9755d6b4ca3032 100644 --- a/docs/en/sql-manual/sql-functions/conditional-functions/ifnull.md +++ b/docs/en/sql-manual/sql-functions/conditional-functions/ifnull.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# ifnull -## description -### Syntax +## ifnull +### description +#### Syntax `ifnull(expr1, expr2)` If the value of expr1 is not null, expr1 is returned, otherwise expr2 is returned -## example +### example ``` mysql> select ifnull(1,0); @@ -50,5 +50,5 @@ mysql> select ifnull(null,10); | 10 | +------------------+ ``` -## keyword +### keywords IFNULL diff --git a/docs/en/sql-manual/sql-functions/conditional-functions/nullif.md b/docs/en/sql-manual/sql-functions/conditional-functions/nullif.md index 12c5ce88becb6d..ab127c56bd7660 100644 --- a/docs/en/sql-manual/sql-functions/conditional-functions/nullif.md +++ b/docs/en/sql-manual/sql-functions/conditional-functions/nullif.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# nullif -## description -### Syntax +## nullif +### description +#### Syntax `nullif(expr1, expr2)` @@ -40,7 +40,7 @@ CASE END ``` -## example +### example ``` mysql> select nullif(1,1); @@ -57,5 +57,5 @@ mysql> select nullif(1,0); | 1 | +--------------+ ``` -## keyword +### keywords NULLIF diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/convert_tz.md b/docs/en/sql-manual/sql-functions/date-time-functions/convert_tz.md index c040635e4abbe7..c5a052ea390bc8 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/convert_tz.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/convert_tz.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# convert_tz -## Description -### Syntax +## convert_tz +### Description +#### Syntax `DATETIME CONVERT_TZ(DATETIME dt, VARCHAR from_tz, VARCHAR to_tz)` Convert datetime value. Go from the given input time zone to the specified time zone and return the result value. If the argument is invalid, the function returns null. -## Example +### Example ``` mysql> select convert_tz('2019-08-01 13:21:03', 'Asia/Shanghai', 'America/Los_Angeles'); @@ -50,6 +50,6 @@ mysql> select convert_tz('2019-08-01 13:21:03', '+08:00', 'America/Los_Angeles') +--------------------------------------------------------------------+ ``` -## keyword +### keywords CONVERT_TZ diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/curdate.md b/docs/en/sql-manual/sql-functions/date-time-functions/curdate.md index f1677893c15997..eb3075a36974e8 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/curdate.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/curdate.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# curdate,current_date -## Description -### Syntax +## curdate,current_date +### Description +#### Syntax `DATE CURDATE()` Get the current date and return it in Date type -## example +### example ``` mysql> SELECT CURDATE(); @@ -49,6 +49,6 @@ mysql> SELECT CURDATE() + 0; | 20191220 | +---------------+ ``` -## keyword +### keywords CURDATE,CURRENT_DATE diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/current_timestamp.md b/docs/en/sql-manual/sql-functions/date-time-functions/current_timestamp.md index a8d9114fb7c6d4..412f0a095d8c3d 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/current_timestamp.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/current_timestamp.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# current_timestamp -## Description -### Syntax +## current_timestamp +### Description +#### Syntax `DATETIME CURRENT_TIMESTAMP()` Get the current time and return it in Datetime type -## example +### example ``` mysql> select current_timestamp(); @@ -43,5 +43,5 @@ mysql> select current_timestamp(); | 2019-05-27 15:59:33 | +---------------------+ ``` -## keyword +### keywords CURRENT_TIMESTAMP,CURRENT,TIMESTAMP diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/curtime.md b/docs/en/sql-manual/sql-functions/date-time-functions/curtime.md index 4f419ca6452832..4b4668d6568ee0 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/curtime.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/curtime.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# curtime,current_time -## Description -### Syntax +## curtime,current_time +### Description +#### Syntax `TIME CURTIME()` Get the current date and return it in Time type -## Examples +### Examples ``` mysql> select current_time(); @@ -43,6 +43,6 @@ mysql> select current_time(); +----------------+ ``` -## keyword +### keywords CURTIME,CURRENT_TIME diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/date_add.md b/docs/en/sql-manual/sql-functions/date-time-functions/date_add.md index abaf1267c0394e..b1868755dcf28d 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/date_add.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/date_add.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# date_add -## Description -### Syntax +## date_add +### Description +#### Syntax `INT DATE_ADD(DATETIME date,INTERVAL expr type)` @@ -39,7 +39,7 @@ The expr parameter is the interval you want to add. Sweet, sweet, sweet -## example +### example ``` mysql> select date_add('2010-11-30 23:59:59', INTERVAL 2 DAY); @@ -49,5 +49,5 @@ mysql> select date_add('2010-11-30 23:59:59', INTERVAL 2 DAY); | 2010-12-02 23:59:59 | +-------------------------------------------------+ ``` -## keyword +### keywords DATE_ADD,DATE,ADD diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/date_format.md b/docs/en/sql-manual/sql-functions/date-time-functions/date_format.md index 8bede2cd14e4e4..5ecfe0b983fe37 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/date_format.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/date_format.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# date_format -## Description -### Syntax +## date_format +### Description +#### Syntax `VARCHAR DATE' FORMAT (DATETIME DATE, VARCHAR Format)` @@ -110,7 +110,7 @@ yyyy-MM-dd yyyy-MM-dd HH:mm:ss -## example +### example ``` mysql> select date_format('2009-10-04 22:23:00', '%W %M %Y'); @@ -162,5 +162,5 @@ mysql> select date_format('2006-06-01', '%%%d'); | %01 | +--------------------------------------------+ ``` -## keyword +### keywords DATE_FORMAT,DATE,FORMAT diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/date_sub.md b/docs/en/sql-manual/sql-functions/date-time-functions/date_sub.md index 3ea8084ba7f5d6..0a83c034fb0c52 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/date_sub.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/date_sub.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# date_sub -## Description -### Syntax +## date_sub +### Description +#### Syntax `INT DATE_SUB(DATETIME date,INTERVAL expr type)` @@ -39,7 +39,7 @@ The expr parameter is the interval you want to add. Sweet, sweet, sweet -## example +### example ``` mysql> select date_sub('2010-11-30 23:59:59', INTERVAL 2 DAY); @@ -49,5 +49,5 @@ mysql> select date_sub('2010-11-30 23:59:59', INTERVAL 2 DAY); | 2010-11-28 23:59:59 | +-------------------------------------------------+ ``` -## keyword +### keywords Date, date, date diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/datediff.md b/docs/en/sql-manual/sql-functions/date-time-functions/datediff.md index 3908f90d205f22..9f84b138d54838 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/datediff.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/datediff.md @@ -25,9 +25,9 @@ under the License. --> -# datediff -## Description -### Syntax +## datediff +### Description +#### Syntax `DATETIME DATEDIFF (DATETIME expr1,DATETIME expr2)` @@ -38,7 +38,7 @@ Expr1 and expr2 parameters are valid date or date/time expressions. Note: Only the date part of the value participates in the calculation. -### example +#### example ``` mysql> select datediff(CAST('2007-12-31 23:59:59' AS DATETIME), CAST('2007-12-30' AS DATETIME)); @@ -55,5 +55,5 @@ mysql> select datediff(CAST('2010-11-30 23:59:59' AS DATETIME), CAST('2010-12-31 | -31 | +-----------------------------------------------------------------------------------+ ``` -## keyword +### keywords DATEDIFF diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/day.md b/docs/en/sql-manual/sql-functions/date-time-functions/day.md index bb58a0539b2d82..999185f9e89e20 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/day.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/day.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# day -## Description -### Syntax +## day +### Description +#### Syntax `INT DAY(DATETIME date)` @@ -35,7 +35,7 @@ Get the day information in the date, and return values range from 1 to 31. The parameter is Date or Datetime type -## example +### example ``` mysql> select day('1987-01-31'); @@ -45,5 +45,5 @@ mysql> select day('1987-01-31'); | 31 | +----------------------------+ ``` -## keyword +### keywords DAY diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/dayname.md b/docs/en/sql-manual/sql-functions/date-time-functions/dayname.md index 780bd6af806cd3..369504f1749cb9 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/dayname.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/dayname.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# dayname -## Description -### Syntax +## dayname +### Description +#### Syntax `VARCHAR DAYNAME (DATE)` @@ -35,7 +35,7 @@ Date name corresponding to return date The parameter is Date or Datetime type -## example +### example ``` mysql> select dayname('2007-02-03 00:00:00'); @@ -45,5 +45,5 @@ mysql> select dayname('2007-02-03 00:00:00'); | Saturday | +--------------------------------+ ``` -## keyword +### keywords DAYNAME diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/dayofmonth.md b/docs/en/sql-manual/sql-functions/date-time-functions/dayofmonth.md index ce20de6c225314..fb1eacb4557c85 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/dayofmonth.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/dayofmonth.md @@ -25,9 +25,9 @@ under the License. --> -# Dayofmonth -## Description -### Syntax +## Dayofmonth +### Description +#### Syntax `INT DAYOFMONTH (DATETIME date)` @@ -36,7 +36,7 @@ Get the day information in the date, and return values range from 1 to 31. The parameter is Date or Datetime type -## example +### example ``` mysql> select dayofmonth('1987-01-31'); @@ -46,5 +46,5 @@ mysql> select dayofmonth('1987-01-31'); | 31 | +-----------------------------------+ ``` -## keyword +### keywords DAYOFMONTH diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/dayofweek.md b/docs/en/sql-manual/sql-functions/date-time-functions/dayofweek.md index 331f8c348090f3..ad2004f5a60527 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/dayofweek.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/dayofweek.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# dayofweek -## Description -### Syntax +## dayofweek +### Description +#### Syntax `INT DAYOFWEEK (DATETIME date)` @@ -35,7 +35,7 @@ The DAYOFWEEK function returns the index value of the working day of the date, t The parameter is Date or Datetime type -## example +### example ``` mysql> select dayofweek('2019-06-25'); +----------------------------------+ @@ -51,5 +51,5 @@ mysql> select dayofweek(cast(20190625 as date)); | 3 | +-----------------------------------+ ``` -## keyword +### keywords DAYOFWEEK diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/dayofyear.md b/docs/en/sql-manual/sql-functions/date-time-functions/dayofyear.md index 96dc490b89d504..1a2ef4ece02a72 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/dayofyear.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/dayofyear.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# Dayofyear -## Description -### Syntax +## Dayofyear +### Description +#### Syntax `INT DAYOFYEAR (DATETIME date)` @@ -35,7 +35,7 @@ The date of acquisition is the date of the corresponding year. The parameter is Date or Datetime type -## example +### example ``` @@ -46,5 +46,5 @@ mysql> select dayofyear('2007-02-03 00:00:00'); | 34 | +----------------------------------+ ``` -## keyword +### keywords DAYOFYEAR diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/from_days.md b/docs/en/sql-manual/sql-functions/date-time-functions/from_days.md index 9994c052326c05..69f043009dd50a 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/from_days.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/from_days.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# from_days -## Description -### Syntax +## from_days +### Description +#### Syntax `DATE FROM_DAYS(INT N)` Calculate which day by the number of days from 0000-01-01 -## example +### example ``` mysql > select from u days (730669); @@ -42,5 +42,5 @@ mysql > select from u days (730669); +-------------------+ | 2000-07-03 | +-------------------+ -## keyword +### keywords FROM_DAYS,FROM,DAYS diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/from_unixtime.md b/docs/en/sql-manual/sql-functions/date-time-functions/from_unixtime.md index bb080a96342eac..832720d83e0514 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/from_unixtime.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/from_unixtime.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# from_unixtime -## description -### syntax +## from_unixtime +### description +#### syntax `DATETIME FROM UNIXTIME (INT unix timestamp [, VARCHAR string format]` @@ -38,7 +38,7 @@ Support `date_format`'s format, and default is `%Y-%m-%d %H:%i:%s` Other `string_format` is illegal and will returns NULL. -## example +### example ``` mysql> select from_unixtime(1196440219); @@ -62,6 +62,6 @@ mysql> select from_unixtime(1196440219, '%Y-%m-%d %H:%i:%s'); | 2007-12-01 00:30:19 | +--------------------------------------------------+ -## keyword +### keywords FROM_UNIXTIME,FROM,UNIXTIME diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/hour.md b/docs/en/sql-manual/sql-functions/date-time-functions/hour.md index 84d4cb08b03cee..8926c9da6f94e6 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/hour.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/hour.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# hour -## description -### Syntax +## hour +### description +#### Syntax `INT HOUR(DATETIME date)` @@ -34,7 +34,7 @@ Returns hour information in the time type, ranging from 0,23 The parameter is Date or Datetime type -## example +### example ``` mysql> select hour('2018-12-31 23:59:59'); @@ -44,5 +44,5 @@ mysql> select hour('2018-12-31 23:59:59'); | 23 | +-----------------------------+ ``` -## keyword +### keywords HOUR diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/makedate.md b/docs/en/sql-manual/sql-functions/date-time-functions/makedate.md index ceea6316dd822d..59a99ccbbac519 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/makedate.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/makedate.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# makedate -## Description -### Syntax +## makedate +### Description +#### Syntax `DATE MAKEDATE(INT year, INT dayofyear)` Returns a date, given year and day-of-year values. dayofyear must be greater than 0 or the result is NULL. -## example +### example ``` mysql> select makedate(2021,1), makedate(2021,100), makedate(2021,400); +-------------------+---------------------+---------------------+ @@ -41,5 +41,5 @@ mysql> select makedate(2021,1), makedate(2021,100), makedate(2021,400); | 2021-01-01 | 2021-04-10 | 2022-02-04 | +-------------------+---------------------+---------------------+ ``` -## keyword +### keywords MAKEDATE \ No newline at end of file diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/minute.md b/docs/en/sql-manual/sql-functions/date-time-functions/minute.md index 9a1ee373797aa6..dfc7a09a0abde7 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/minute.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/minute.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# minute -## description -### Syntax +## minute +### description +#### Syntax `INT MINUTE(DATETIME date)` @@ -34,7 +34,7 @@ Returns minute information in the time type, ranging from 0,59 The parameter is Date or Datetime type -## example +### example ``` mysql> select minute('2018-12-31 23:59:59'); @@ -44,5 +44,5 @@ mysql> select minute('2018-12-31 23:59:59'); | 59 | +-----------------------------+ ``` -## keyword +### keywords MINUTE diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/month.md b/docs/en/sql-manual/sql-functions/date-time-functions/month.md index c26f13d601afcb..b5466c532264ad 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/month.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/month.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# month -## Description -### Syntax +## month +### Description +#### Syntax `INT MONTH (DATETIME date)` @@ -35,7 +35,7 @@ Returns month information in the time type, ranging from 1,12 The parameter is Date or Datetime type -## example +### example ``` mysql> select month('1987-01-01'); @@ -45,5 +45,5 @@ mysql> select month('1987-01-01'); | 1 | +-----------------------------+ ``` -## keyword +### keywords MONTH diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/monthname.md b/docs/en/sql-manual/sql-functions/date-time-functions/monthname.md index 277d0d804c6a6c..c693e8e35548fe 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/monthname.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/monthname.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# Monthname -## Description -### Syntax +## Monthname +### Description +#### Syntax `VARCHAR MONTHNAME (DATE)` @@ -35,7 +35,7 @@ Month name corresponding to return date The parameter is Date or Datetime type -## example +### example ``` mysql> select monthname('2008-02-03 00:00:00'); @@ -45,5 +45,5 @@ mysql> select monthname('2008-02-03 00:00:00'); | February | +----------------------------------+ ``` -## keyword +### keywords MONTHNAME diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/now.md b/docs/en/sql-manual/sql-functions/date-time-functions/now.md index 36f2f010377e5d..4fd9fd8e119d62 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/now.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/now.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# now -## Description -### Syntax +## now +### Description +#### Syntax `DATETIME NOW ()` Get the current time and return it in Datetime type -## example +### example ``` mysql> select now(); @@ -43,5 +43,5 @@ mysql> select now(); | 2019-05-27 15:58:25 | +---------------------+ ``` -## keyword +### keywords NOW diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/second.md b/docs/en/sql-manual/sql-functions/date-time-functions/second.md index 02abb9d5588df8..fc8a7938eb0357 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/second.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/second.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# second -## description -### Syntax +## second +### description +#### Syntax `INT SECOND(DATETIME date)` @@ -34,7 +34,7 @@ Returns second information in the time type, ranging from 0,59 The parameter is Date or Datetime type -## example +### example ``` mysql> select second('2018-12-31 23:59:59'); @@ -44,5 +44,5 @@ mysql> select second('2018-12-31 23:59:59'); | 59 | +-----------------------------+ ``` -## keyword +### keywords SECOND diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/str_to_date.md b/docs/en/sql-manual/sql-functions/date-time-functions/str_to_date.md index 27d741b0819501..72a5e2fb819853 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/str_to_date.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/str_to_date.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# Str_to_date -## Description -### Syntax +## Str_to_date +### Description +#### Syntax `DATETIME STR TWO DATES (VARCHAR STR, VARCHAR format)` @@ -35,7 +35,7 @@ Convert STR to DATE type by format specified, if the conversion result does not The format format supported is consistent with date_format -## example +### example ``` mysql> select str_to_date('2014-12-21 12:34:56', '%Y-%m-%d %H:%i:%s'); @@ -67,6 +67,6 @@ mysql> select str_to_date("2020-09-01", "%Y-%m-%d %H:%i:%s"); +------------------------------------------------+ 1 row in set (0.01 sec) ``` -## keyword +### keywords STR_TO_DATE,STR,TO,DATE diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/time_round.md b/docs/en/sql-manual/sql-functions/date-time-functions/time_round.md index f336bf2827f019..f6a7539642577f 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/time_round.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/time_round.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# time_round -## description -### Syntax +## time_round +### description +#### Syntax `DATETIME TIME_ROUND(DATETIME expr)` @@ -46,7 +46,7 @@ Returns the upper/lower bound of `expr`. - `origin` specifies the start time of the period, the default is `1970-01-01T00:00:00`, the start time of `WEEK` is Sunday, which is `1970-01-04T00:00:00`. Could be larger than `expr`. - Please try to choose common `period`, such as 3 `MONTH`, 90 `MINUTE`. If you set a uncommon `period`, please also specify `origin`. -## example +### example ``` @@ -82,5 +82,5 @@ MySQL> SELECT MONTH_CEIL(CAST('2020-02-02 13:09:20' AS DATETIME), 3, CAST('1970- +-------------------------------------------------------------------------------------------------+ ``` -## keyword +### keywords TIME_ROUND diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/timediff.md b/docs/en/sql-manual/sql-functions/date-time-functions/timediff.md index 587464941e870f..9862c1af7a7c75 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/timediff.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/timediff.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# timediff -## Description -### Syntax +## timediff +### Description +#### Syntax `TIME TIMEDIFF (DATETIME expr1, DATETIME expr2)` @@ -37,7 +37,7 @@ The TIMEDIFF function returns the result of expr1 - expr2 expressed as a time va The results are limited to TIME values ranging from - 838:59:59 to 838:59:59. -### example +#### example ``` mysql> SELECT TIMEDIFF(now(),utc_timestamp()); @@ -61,5 +61,5 @@ mysql> SELECT TIMEDIFF('2019-01-01 00:00:00', NULL); | NULL | +---------------------------------------+ ``` -## keyword +### keywords TIMEDIFF diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/timestampadd.md b/docs/en/sql-manual/sql-functions/date-time-functions/timestampadd.md index 9ba83952a854f8..88b7f4cf46bc5a 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/timestampadd.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/timestampadd.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# timestampadd -## description -### Syntax +## timestampadd +### description +#### Syntax `DATETIME TIMESTAMPADD(unit, interval, DATETIME datetime_expr)` @@ -36,7 +36,7 @@ The unit for interval is given by the unit argument, which should be one of the SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, or YEAR. -## example +### example ``` @@ -54,5 +54,5 @@ mysql> SELECT TIMESTAMPADD(WEEK,1,'2019-01-02'); | 2019-01-09 00:00:00 | +----------------------------------------------+ ``` -## keyword +### keywords TIMESTAMPADD diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/timestampdiff.md b/docs/en/sql-manual/sql-functions/date-time-functions/timestampdiff.md index 1776182f7167a7..16ee64762f2149 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/timestampdiff.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/timestampdiff.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# timestampdiff -## description -### Syntax +## timestampdiff +### description +#### Syntax `INT TIMESTAMPDIFF(unit,DATETIME datetime_expr1, DATETIME datetime_expr2)` @@ -36,7 +36,7 @@ The unit for the result (an integer) is given by the unit argument. The legal values for unit are the same as those listed in the description of the TIMESTAMPADD() function. -## example +### example ``` @@ -63,5 +63,5 @@ MySQL> SELECT TIMESTAMPDIFF(MINUTE,'2003-02-01','2003-05-01 12:05:55'); +---------------------------------------------------------------------+ ``` -## keyword +### keywords TIMESTAMPDIFF diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/to_date.md b/docs/en/sql-manual/sql-functions/date-time-functions/to_date.md index 2f85b2f4782d11..02ae971d4cf8d9 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/to_date.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/to_date.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# to_date -## description -### Syntax +## to_date +### description +#### Syntax `DATE TO_DATE(DATETIME)` Return the DATE part of DATETIME value. -## example +### example ``` mysql> select to_date("2020-02-02 00:00:00"); @@ -43,6 +43,6 @@ mysql> select to_date("2020-02-02 00:00:00"); +--------------------------------+ ``` -## keyword +### keywords TO_DATE diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/to_days.md b/docs/en/sql-manual/sql-functions/date-time-functions/to_days.md index 67c777b2e0b22d..d54c34a5abad5f 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/to_days.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/to_days.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# to_days -## Description -### Syntax +## to_days +### Description +#### Syntax `INT TO DAYS` @@ -35,7 +35,7 @@ Days of returning date distance 0000-01-01 The parameter is Date or Datetime type -## example +### example ``` mysql> select to_days('2007-10-07'); @@ -46,5 +46,5 @@ mysql> select to_days('2007-10-07'); +-----------------------+ ``` -## keyword +### keywords TO_DAYS,TO,DAYS diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/unix_timestamp.md b/docs/en/sql-manual/sql-functions/date-time-functions/unix_timestamp.md index e4f920005ddcb4..8f5a6d32680ad3 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/unix_timestamp.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/unix_timestamp.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# unix_timestamp -## Description -### Syntax +## unix_timestamp +### Description +#### Syntax `INT UNIX_TIMESTAMP(), UNIX_TIMESTAMP(DATETIME date)` @@ -42,7 +42,7 @@ See `date_format` function to get Format explanation. This function is affected by time zone. -## example +### example ``` mysql> select unix_timestamp(); @@ -81,6 +81,6 @@ mysql> select unix_timestamp('1969-01-01 00:00:00'); +---------------------------------------+ ``` -## keyword +### keywords UNIX_TIMESTAMP,UNIX,TIMESTAMP diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/utc_timestamp.md b/docs/en/sql-manual/sql-functions/date-time-functions/utc_timestamp.md index 907f48c220a33a..e173c3dedb444f 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/utc_timestamp.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/utc_timestamp.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# utc_timestamp -## Description -### Syntax +## utc_timestamp +### Description +#### Syntax `DATETIME UTC_TIMESTAMP()` @@ -37,7 +37,7 @@ A Value of "YYYYMMDDHMMSS" Format Depending on whether the function is used in a string or numeric context -## example +### example ``` mysql> select utc_timestamp(),utc_timestamp() + 1; @@ -46,5 +46,5 @@ mysql> select utc_timestamp(),utc_timestamp() + 1; +---------------------+---------------------+ | 2019-07-10 12:31:18 | 20190710123119 | +---------------------+---------------------+ -## keyword +### keywords UTC_TIMESTAMP,UTC,TIMESTAMP diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/week.md b/docs/en/sql-manual/sql-functions/date-time-functions/week.md index 03d4d0a1563455..ef23d174f82d19 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/week.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/week.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# week -## Description -### Syntax +## week +### Description +#### Syntax `INT WEEK(DATE date)` `INT WEEK(DATE date, INT mode)` @@ -46,7 +46,7 @@ The following table describes how the mode argument works. The parameter is Date or Datetime type -## example +### example ``` mysql> select week('2020-1-1'); +------------------+ @@ -63,5 +63,5 @@ mysql> select week('2020-7-1',1); | 27 | +---------------------+ ``` -## keyword +### keywords WEEK diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/weekday.md b/docs/en/sql-manual/sql-functions/date-time-functions/weekday.md index 0626600e9cb63d..1c94a626353043 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/weekday.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/weekday.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# weekday -## Description -### Syntax +## weekday +### Description +#### Syntax `INT WEEKDAY (DATETIME date)` @@ -46,7 +46,7 @@ dayofweek | 1 | 2 | 3 | 4 | 5 | 6 | 7 | +-----+-----+-----+-----+-----+-----+-----+ ``` -## example +### example ``` mysql> select weekday('2019-06-25'); +--------------------------------+ @@ -62,5 +62,5 @@ mysql> select weekday(cast(20190625 as date)); | 1 | +---------------------------------+ ``` -## keyword +### keywords WEEKDAY \ No newline at end of file diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/weekofyear.md b/docs/en/sql-manual/sql-functions/date-time-functions/weekofyear.md index 6b9d033a8a1873..43385eda341f10 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/weekofyear.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/weekofyear.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# weekofyear -## Description -### Syntax +## weekofyear +### Description +#### Syntax `INT WEEKOFYEAR (DATETIME DATE)` @@ -36,7 +36,7 @@ Get the Weeks of the Year The parameter is Date or Datetime type -## example +### example ``` mysql> select weekofyear('2008-02-20 00:00:00'); @@ -46,5 +46,5 @@ mysql> select weekofyear('2008-02-20 00:00:00'); | 8 | +-----------------------------------+ ``` -## keyword +### keywords WEEKOFYEAR diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/year.md b/docs/en/sql-manual/sql-functions/date-time-functions/year.md index 204a75c9d36ed5..84c687286ca6b1 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/year.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/year.md @@ -25,9 +25,9 @@ under the License. --> -# year -## Description -### Syntax +## year +### Description +#### Syntax `INT YEAR(DATETIME date)` @@ -36,7 +36,7 @@ Returns the year part of the date type, ranging from 1000 to 9999 The parameter is Date or Datetime type -## example +### example ``` mysql> select year('1987-01-01'); @@ -46,5 +46,5 @@ mysql> select year('1987-01-01'); | 1987 | +-----------------------------+ ``` -## keyword +### keywords YEAR diff --git a/docs/en/sql-manual/sql-functions/date-time-functions/yearweek.md b/docs/en/sql-manual/sql-functions/date-time-functions/yearweek.md index 42e9d51cd4f51d..b5358bcf91fc60 100644 --- a/docs/en/sql-manual/sql-functions/date-time-functions/yearweek.md +++ b/docs/en/sql-manual/sql-functions/date-time-functions/yearweek.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# yearweek -## Description -### Syntax +## yearweek +### Description +#### Syntax `INT YEARWEEK(DATE date)` `INT YEARWEEK(DATE date, INT mode)` @@ -49,7 +49,7 @@ The following table describes how the mode argument works. The parameter is Date or Datetime type -## example +### example ``` mysql> select yearweek('2021-1-1'); +----------------------+ @@ -75,5 +75,5 @@ mysql> select yearweek('2024-12-30',1); +------------------------------------+ ``` -## keyword +### keywords YEARWEEK diff --git a/docs/en/sql-manual/sql-functions/digital-masking.md b/docs/en/sql-manual/sql-functions/digital-masking.md index f8ce74403ff9e9..97c6c69dff327f 100644 --- a/docs/en/sql-manual/sql-functions/digital-masking.md +++ b/docs/en/sql-manual/sql-functions/digital-masking.md @@ -24,11 +24,11 @@ specific language governing permissions and limitations under the License. --> -# DIGITAL_MASKING +## DIGITAL_MASKING -## description +### description -### Syntax +#### Syntax ``` digital_masking(digital_number) @@ -38,7 +38,7 @@ Alias function, the original function is `concat(left(id,3),'****',right(id,4))` Desensitizes the input `digital_number` and returns the result after masking desensitization. `digital_number` is `BIGINT` data type. -## example +### example 1. Desensitize the cell phone number @@ -51,6 +51,6 @@ Desensitizes the input `digital_number` and returns the result after masking des +------------------------------+ ``` -## keyword +### keywords DIGITAL_MASKING diff --git a/docs/en/sql-manual/sql-functions/encrypt-digest-functions/aes.md b/docs/en/sql-manual/sql-functions/encrypt-digest-functions/aes.md index 7b3083d9a2e421..a1e2d25840ea26 100644 --- a/docs/en/sql-manual/sql-functions/encrypt-digest-functions/aes.md +++ b/docs/en/sql-manual/sql-functions/encrypt-digest-functions/aes.md @@ -22,15 +22,15 @@ specific language governing permissions and limitations under the License. --> -# AES_ENCRYPT +## AES_ENCRYPT -## description +### description encryption of data using the official AES -### Syntax +#### Syntax `VARCHAR AES_ENCRYPT(str,key_str[,init_vector])` -## example +### example ``` MySQL > select to_base64(AES_ENCRYPT('text','F3229A0B371ED2D9441B830D21A390C3')); @@ -53,14 +53,18 @@ MySQL > select to_base64(AES_ENCRYPT('text','F3229A0B371ED2D9441B830D21A390C3', 1 row in set (0.011 sec) ``` -# AES_DECRYPT +### keywords -## description + AES_ENCRYPT + +## AES_DECRYPT + +### description decryption of data using the official AES (### Syntax `VARCHAR AES_DECRYPT(str,key_str[,init_vector])` -## example +### example ``` MySQL > select AES_DECRYPT(FROM_BASE64('wr2JEDVXzL9+2XtRhgIloA=='),'F3229A0B371ED2D9441B830D21A390C3'); @@ -83,6 +87,6 @@ MySQL > select AES_DECRYPT(FROM_BASE64('mvZT1KJw7N0RJf27aipUpg=='),'F3229A0B371E 1 row in set (0.012 sec) ``` -## keyword +### keywords - AES_ENCRYPT, AES_DECRYPT \ No newline at end of file + AES_DECRYPT diff --git a/docs/en/sql-manual/sql-functions/encrypt-digest-functions/md5.md b/docs/en/sql-manual/sql-functions/encrypt-digest-functions/md5.md index de2cca23ec7fe5..723637544e27dc 100644 --- a/docs/en/sql-manual/sql-functions/encrypt-digest-functions/md5.md +++ b/docs/en/sql-manual/sql-functions/encrypt-digest-functions/md5.md @@ -22,15 +22,15 @@ specific language governing permissions and limitations under the License. --> -# MD5 +## MD5 -## description +### description Calculates an MD5 128-bit checksum for the string -### Syntax +#### Syntax `MD5(str)` -## example +### example ``` MySQL [(none)]> select md5("abc"); @@ -42,6 +42,6 @@ MySQL [(none)]> select md5("abc"); 1 row in set (0.013 sec) ``` -## keyword +### keywords MD5 \ No newline at end of file diff --git a/docs/en/sql-manual/sql-functions/encrypt-digest-functions/md5sum.md b/docs/en/sql-manual/sql-functions/encrypt-digest-functions/md5sum.md index 7ff1d18e758a5d..a801e1254c9681 100644 --- a/docs/en/sql-manual/sql-functions/encrypt-digest-functions/md5sum.md +++ b/docs/en/sql-manual/sql-functions/encrypt-digest-functions/md5sum.md @@ -22,15 +22,15 @@ specific language governing permissions and limitations under the License. --> -# MD5SUM +## MD5SUM -## description +### description Calculates an MD5 128-bit checksum for the strings -### Syntax +#### Syntax `MD5SUM(str[,str])` -## example +### example ``` MySQL > select md5("abcd"); @@ -51,6 +51,6 @@ MySQL > select md5sum("ab","cd"); ``` -## keyword +### keywords MD5SUM \ No newline at end of file diff --git a/docs/en/sql-manual/sql-functions/encrypt-digest-functions/sm3.md b/docs/en/sql-manual/sql-functions/encrypt-digest-functions/sm3.md index 85d09e87e7958a..6dc63cdb9cd3cc 100644 --- a/docs/en/sql-manual/sql-functions/encrypt-digest-functions/sm3.md +++ b/docs/en/sql-manual/sql-functions/encrypt-digest-functions/sm3.md @@ -22,15 +22,15 @@ specific language governing permissions and limitations under the License. --> -# SM3 +## SM3 -## description +### description Calculates an SM3 256-bit checksum for the string -### Syntax +#### Syntax `SM3(str)` -## example +### example ``` MySQL > select sm3("abcd"); @@ -42,6 +42,6 @@ MySQL > select sm3("abcd"); 1 row in set (0.009 sec) ``` -## keyword +### keywords SM3 \ No newline at end of file diff --git a/docs/en/sql-manual/sql-functions/encrypt-digest-functions/sm3sum.md b/docs/en/sql-manual/sql-functions/encrypt-digest-functions/sm3sum.md index 33e8b131c577af..b8b940a1734bfb 100644 --- a/docs/en/sql-manual/sql-functions/encrypt-digest-functions/sm3sum.md +++ b/docs/en/sql-manual/sql-functions/encrypt-digest-functions/sm3sum.md @@ -22,15 +22,15 @@ specific language governing permissions and limitations under the License. --> -# SM3SUM +## SM3SUM -## description +### description Calculates an SM3 128-bit checksum for the strings -### Syntax +#### Syntax `SM3SUM(str[,str])` -## example +### example ``` MySQL > select sm3("abcd"); @@ -51,6 +51,6 @@ MySQL > select sm3sum("ab","cd"); ``` -## keyword +### keywords SM3SUM \ No newline at end of file diff --git a/docs/en/sql-manual/sql-functions/encrypt-digest-functions/sm4.md b/docs/en/sql-manual/sql-functions/encrypt-digest-functions/sm4.md index 29f860a796bad1..ec1f05f20db968 100644 --- a/docs/en/sql-manual/sql-functions/encrypt-digest-functions/sm4.md +++ b/docs/en/sql-manual/sql-functions/encrypt-digest-functions/sm4.md @@ -22,17 +22,17 @@ specific language governing permissions and limitations under the License. --> -# SM4_ENCRYPT +## SM4_ENCRYPT -## description -SM4 加密函数 -### Syntax +### description + +#### Syntax `VARCHAR SM4_ENCRYPT(str,key_str[,init_vector])` -返回加密后的结果 +return encrypted result -## example +### example ``` MySQL > select TO_BASE64(SM4_ENCRYPT('text','F3229A0B371ED2D9441B830D21A390C3')); @@ -55,17 +55,21 @@ MySQL > select to_base64(SM4_ENCRYPT('text','F3229A0B371ED2D9441B830D21A390C3', 1 row in set (0.014 sec) ``` -# SM4_DECRYPT +### keywords + + SM4_ENCRYPT + +## SM4_DECRYPT + +### description -## description -Aes 解密函数 -### Syntax +#### Syntax -`VARCHAR AES_DECRYPT(str,key_str[,init_vector])` +`VARCHAR SM4_DECRYPT(str,key_str[,init_vector])` -返回解密后的结果 +Return the decrypted result -## example +### example ``` MySQL [(none)]> select SM4_DECRYPT(FROM_BASE64('aDjwRflBrDjhBZIOFNw3Tg=='),'F3229A0B371ED2D9441B830D21A390C3'); @@ -88,6 +92,6 @@ MySQL > select SM4_DECRYPT(FROM_BASE64('G7yqOKfEyxdagboz6Qf01A=='),'F3229A0B371E 1 row in set (0.012 sec) ``` -## keyword +### keywords - SM4_ENCRYPT, SM4_DECRYPT \ No newline at end of file + SM4_DECRYPT diff --git a/docs/en/sql-manual/sql-functions/encrypt-dixgest-functions/aes.md b/docs/en/sql-manual/sql-functions/encrypt-dixgest-functions/aes.md deleted file mode 100644 index 7b3083d9a2e421..00000000000000 --- a/docs/en/sql-manual/sql-functions/encrypt-dixgest-functions/aes.md +++ /dev/null @@ -1,88 +0,0 @@ ---- -{ -"title": "AES", -"language": "en" -} ---- - - - -# AES_ENCRYPT - -## description -encryption of data using the official AES -### Syntax - -`VARCHAR AES_ENCRYPT(str,key_str[,init_vector])` - -## example - -``` -MySQL > select to_base64(AES_ENCRYPT('text','F3229A0B371ED2D9441B830D21A390C3')); -+--------------------------------+ -| to_base64(aes_encrypt('text')) | -+--------------------------------+ -| wr2JEDVXzL9+2XtRhgIloA== | -+--------------------------------+ -1 row in set (0.010 sec) - -MySQL> set block_encryption_mode="AES_256_CBC"; -Query OK, 0 rows affected (0.006 sec) - -MySQL > select to_base64(AES_ENCRYPT('text','F3229A0B371ED2D9441B830D21A390C3', '0123456789')); -+----------------------------------------------------------------------------------+ -| to_base64(aes_encrypt('text', 'F3229A0B371ED2D9441B830D21A390C3', '0123456789')) | -+----------------------------------------------------------------------------------+ -| mvZT1KJw7N0RJf27aipUpg== | -+----------------------------------------------------------------------------------+ -1 row in set (0.011 sec) -``` - -# AES_DECRYPT - -## description -decryption of data using the official AES (### Syntax - -`VARCHAR AES_DECRYPT(str,key_str[,init_vector])` - -## example - -``` -MySQL > select AES_DECRYPT(FROM_BASE64('wr2JEDVXzL9+2XtRhgIloA=='),'F3229A0B371ED2D9441B830D21A390C3'); -+------------------------------------------------------+ -| aes_decrypt(from_base64('wr2JEDVXzL9+2XtRhgIloA==')) | -+------------------------------------------------------+ -| text | -+------------------------------------------------------+ -1 row in set (0.012 sec) - -MySQL> set block_encryption_mode="AES_256_CBC"; -Query OK, 0 rows affected (0.006 sec) - -MySQL > select AES_DECRYPT(FROM_BASE64('mvZT1KJw7N0RJf27aipUpg=='),'F3229A0B371ED2D9441B830D21A390C3', '0123456789'); -+--------------------------------------------------------------------------------------------------------+ -| aes_decrypt(from_base64('mvZT1KJw7N0RJf27aipUpg=='), 'F3229A0B371ED2D9441B830D21A390C3', '0123456789') | -+--------------------------------------------------------------------------------------------------------+ -| text | -+--------------------------------------------------------------------------------------------------------+ -1 row in set (0.012 sec) -``` - -## keyword - - AES_ENCRYPT, AES_DECRYPT \ No newline at end of file diff --git a/docs/en/sql-manual/sql-functions/encrypt-dixgest-functions/md5.md b/docs/en/sql-manual/sql-functions/encrypt-dixgest-functions/md5.md deleted file mode 100644 index de2cca23ec7fe5..00000000000000 --- a/docs/en/sql-manual/sql-functions/encrypt-dixgest-functions/md5.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -{ -"title": "MD5", -"language": "en" -} ---- - - - -# MD5 - -## description -Calculates an MD5 128-bit checksum for the string -### Syntax - -`MD5(str)` - -## example - -``` -MySQL [(none)]> select md5("abc"); -+----------------------------------+ -| md5('abc') | -+----------------------------------+ -| 900150983cd24fb0d6963f7d28e17f72 | -+----------------------------------+ -1 row in set (0.013 sec) -``` - -## keyword - - MD5 \ No newline at end of file diff --git a/docs/en/sql-manual/sql-functions/encrypt-dixgest-functions/md5sum.md b/docs/en/sql-manual/sql-functions/encrypt-dixgest-functions/md5sum.md deleted file mode 100644 index 7ff1d18e758a5d..00000000000000 --- a/docs/en/sql-manual/sql-functions/encrypt-dixgest-functions/md5sum.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -{ -"title": "MD5SUM", -"language": "en" -} ---- - - - -# MD5SUM - -## description -Calculates an MD5 128-bit checksum for the strings -### Syntax - -`MD5SUM(str[,str])` - -## example - -``` -MySQL > select md5("abcd"); -+----------------------------------+ -| md5('abcd') | -+----------------------------------+ -| e2fc714c4727ee9395f324cd2e7f331f | -+----------------------------------+ -1 row in set (0.011 sec) - -MySQL > select md5sum("ab","cd"); -+----------------------------------+ -| md5sum('ab', 'cd') | -+----------------------------------+ -| e2fc714c4727ee9395f324cd2e7f331f | -+----------------------------------+ -1 row in set (0.008 sec) - -``` - -## keyword - - MD5SUM \ No newline at end of file diff --git a/docs/en/sql-manual/sql-functions/encrypt-dixgest-functions/sm3.md b/docs/en/sql-manual/sql-functions/encrypt-dixgest-functions/sm3.md deleted file mode 100644 index 85d09e87e7958a..00000000000000 --- a/docs/en/sql-manual/sql-functions/encrypt-dixgest-functions/sm3.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -{ -"title": "SM3", -"language": "en" -} ---- - - - -# SM3 - -## description -Calculates an SM3 256-bit checksum for the string -### Syntax - -`SM3(str)` - -## example - -``` -MySQL > select sm3("abcd"); -+------------------------------------------------------------------+ -| sm3('abcd') | -+------------------------------------------------------------------+ -| 82ec580fe6d36ae4f81cae3c73f4a5b3b5a09c943172dc9053c69fd8e18dca1e | -+------------------------------------------------------------------+ -1 row in set (0.009 sec) -``` - -## keyword - - SM3 \ No newline at end of file diff --git a/docs/en/sql-manual/sql-functions/encrypt-dixgest-functions/sm3sum.md b/docs/en/sql-manual/sql-functions/encrypt-dixgest-functions/sm3sum.md deleted file mode 100644 index 33e8b131c577af..00000000000000 --- a/docs/en/sql-manual/sql-functions/encrypt-dixgest-functions/sm3sum.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -{ -"title": "SM3SUM", -"language": "en" -} ---- - - - -# SM3SUM - -## description -Calculates an SM3 128-bit checksum for the strings -### Syntax - -`SM3SUM(str[,str])` - -## example - -``` -MySQL > select sm3("abcd"); -+------------------------------------------------------------------+ -| sm3('abcd') | -+------------------------------------------------------------------+ -| 82ec580fe6d36ae4f81cae3c73f4a5b3b5a09c943172dc9053c69fd8e18dca1e | -+------------------------------------------------------------------+ -1 row in set (0.009 sec) - -MySQL > select sm3sum("ab","cd"); -+------------------------------------------------------------------+ -| sm3sum('ab', 'cd') | -+------------------------------------------------------------------+ -| 82ec580fe6d36ae4f81cae3c73f4a5b3b5a09c943172dc9053c69fd8e18dca1e | -+------------------------------------------------------------------+ -1 row in set (0.009 sec) - -``` - -## keyword - - SM3SUM \ No newline at end of file diff --git a/docs/en/sql-manual/sql-functions/encrypt-dixgest-functions/sm4.md b/docs/en/sql-manual/sql-functions/encrypt-dixgest-functions/sm4.md deleted file mode 100644 index 29f860a796bad1..00000000000000 --- a/docs/en/sql-manual/sql-functions/encrypt-dixgest-functions/sm4.md +++ /dev/null @@ -1,93 +0,0 @@ ---- -{ -"title": "SM4", -"language": "en" -} ---- - - - -# SM4_ENCRYPT - -## description -SM4 加密函数 -### Syntax - -`VARCHAR SM4_ENCRYPT(str,key_str[,init_vector])` - -返回加密后的结果 - -## example - -``` -MySQL > select TO_BASE64(SM4_ENCRYPT('text','F3229A0B371ED2D9441B830D21A390C3')); -+--------------------------------+ -| to_base64(sm4_encrypt('text')) | -+--------------------------------+ -| aDjwRflBrDjhBZIOFNw3Tg== | -+--------------------------------+ -1 row in set (0.010 sec) - -MySQL > set block_encryption_mode="SM4_128_CBC"; -Query OK, 0 rows affected (0.001 sec) - -MySQL > select to_base64(SM4_ENCRYPT('text','F3229A0B371ED2D9441B830D21A390C3', '0123456789')); -+----------------------------------------------------------------------------------+ -| to_base64(sm4_encrypt('text', 'F3229A0B371ED2D9441B830D21A390C3', '0123456789')) | -+----------------------------------------------------------------------------------+ -| G7yqOKfEyxdagboz6Qf01A== | -+----------------------------------------------------------------------------------+ -1 row in set (0.014 sec) -``` - -# SM4_DECRYPT - -## description -Aes 解密函数 -### Syntax - -`VARCHAR AES_DECRYPT(str,key_str[,init_vector])` - -返回解密后的结果 - -## example - -``` -MySQL [(none)]> select SM4_DECRYPT(FROM_BASE64('aDjwRflBrDjhBZIOFNw3Tg=='),'F3229A0B371ED2D9441B830D21A390C3'); -+------------------------------------------------------+ -| sm4_decrypt(from_base64('aDjwRflBrDjhBZIOFNw3Tg==')) | -+------------------------------------------------------+ -| text | -+------------------------------------------------------+ -1 row in set (0.009 sec) - -MySQL> set block_encryption_mode="SM4_128_CBC"; -Query OK, 0 rows affected (0.006 sec) - -MySQL > select SM4_DECRYPT(FROM_BASE64('G7yqOKfEyxdagboz6Qf01A=='),'F3229A0B371ED2D9441B830D21A390C3', '0123456789'); -+--------------------------------------------------------------------------------------------------------+ -| sm4_decrypt(from_base64('G7yqOKfEyxdagboz6Qf01A=='), 'F3229A0B371ED2D9441B830D21A390C3', '0123456789') | -+--------------------------------------------------------------------------------------------------------+ -| text | -+--------------------------------------------------------------------------------------------------------+ -1 row in set (0.012 sec) -``` - -## keyword - - SM4_ENCRYPT, SM4_DECRYPT \ No newline at end of file diff --git a/docs/en/sql-manual/sql-functions/hash-functions/murmur_hash3_32.md b/docs/en/sql-manual/sql-functions/hash-functions/murmur_hash3_32.md index d75d9380b7e6e5..f9e537a40a82fd 100644 --- a/docs/en/sql-manual/sql-functions/hash-functions/murmur_hash3_32.md +++ b/docs/en/sql-manual/sql-functions/hash-functions/murmur_hash3_32.md @@ -22,16 +22,16 @@ specific language governing permissions and limitations under the License. --> -# murmur_hash3_32 +## murmur_hash3_32 -## description -### Syntax +### description +#### Syntax `INT MURMUR_HASH3_32(VARCHAR input, ...)` Return the 32 bits murmur3 hash of input string. -## example +### example ``` mysql> select murmur_hash3_32(null); @@ -56,6 +56,6 @@ mysql> select murmur_hash3_32("hello", "world"); +-----------------------------------+ ``` -## keyword +### keywords MURMUR_HASH3_32,HASH diff --git a/docs/en/sql-manual/sql-functions/json-functions/get_json_double.md b/docs/en/sql-manual/sql-functions/json-functions/get_json_double.md index f57653c5cfdc64..ef6e18d0a46e0f 100644 --- a/docs/en/sql-manual/sql-functions/json-functions/get_json_double.md +++ b/docs/en/sql-manual/sql-functions/json-functions/get_json_double.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# get_json_double -## description -### Syntax +## get_json_double +### description +#### Syntax `DOUBLE get_json_double(VARCHAR json_str, VARCHAR json_path)` @@ -37,7 +37,7 @@ Use [] to denote array subscripts, starting at 0. The content of path cannot contain ",[and]. If the json_string format is incorrect, or the json_path format is incorrect, or matches cannot be found, NULL is returned. -## example +### example 1. Get the value of key as "k1" @@ -70,5 +70,5 @@ mysql> SELECT get_json_double('{"k1.key":{"k2":[1.1, 2.2]}}', '$."k1.key".k2[0]' | 1.1 | +---------------------------------------------------------------------+ ``` -## keyword +### keywords GET_JSON_DOUBLE,GET,JSON,DOUBLE diff --git a/docs/en/sql-manual/sql-functions/json-functions/get_json_int.md b/docs/en/sql-manual/sql-functions/json-functions/get_json_int.md index 3367be5d14d4f8..20144d9fd78dd8 100644 --- a/docs/en/sql-manual/sql-functions/json-functions/get_json_int.md +++ b/docs/en/sql-manual/sql-functions/json-functions/get_json_int.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# get_json_int -## Description -### Syntax +## get_json_int +### Description +#### Syntax `INT get_json_int(VARCHAR json_str, VARCHAR json_path)` @@ -37,7 +37,7 @@ Use [] to denote array subscripts, starting at 0. The content of path cannot contain ",[and]. If the json_string format is incorrect, or the json_path format is incorrect, or matches cannot be found, NULL is returned. -## example +### example 1. Get the value of key as "k1" @@ -70,5 +70,5 @@ mysql> SELECT get_json_int('{"k1.key":{"k2":[1, 2]}}', '$."k1.key".k2[0]'); | 1 | +--------------------------------------------------------------+ ``` -## keyword +### keywords GET_JSON_INT,GET,JSON,INT diff --git a/docs/en/sql-manual/sql-functions/json-functions/get_json_string.md b/docs/en/sql-manual/sql-functions/json-functions/get_json_string.md index 9ce4c9480ad28a..746750e995c80a 100644 --- a/docs/en/sql-manual/sql-functions/json-functions/get_json_string.md +++ b/docs/en/sql-manual/sql-functions/json-functions/get_json_string.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# get_json_string -## description -### Syntax +## get_json_string +### description +#### Syntax `VARCHAR get_json_string (VARCHAR json str, VARCHAR json path)` @@ -37,7 +37,7 @@ Use [] to denote array subscripts, starting at 0. The content of path cannot contain ",[and]. If the json_string format is incorrect, or the json_path format is incorrect, or matches cannot be found, NULL is returned. -## example +### example 1. Get the value of key as "k1" @@ -80,5 +80,5 @@ mysql> SELECT get_json_string('[{"k1":"v1"}, {"k2":"v2"}, {"k1":"v3"}, {"k1":"v4 | ["v1","v3","v4"] | +---------------------------------------------------------------------------------+ ``` -## keyword +### keywords GET_JSON_STRING,GET,JSON,STRING diff --git a/docs/en/sql-manual/sql-functions/json-functions/json_array.md b/docs/en/sql-manual/sql-functions/json-functions/json_array.md index cceb11cb124bbe..14e99263ec3a41 100644 --- a/docs/en/sql-manual/sql-functions/json-functions/json_array.md +++ b/docs/en/sql-manual/sql-functions/json-functions/json_array.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# json_array -## Description -### Syntax +## json_array +### Description +#### Syntax `VARCHAR json_array(VARCHAR,...)` Generate a json array containing the specified values, return empty if no values -## example +### example ``` MySQL> select json_array(); @@ -66,5 +66,5 @@ MySQL> select json_array("a", null, "c"); | ["a", NULL, "c"] | +------------------------------+ ``` -## keyword +### keywords json_array diff --git a/docs/en/sql-manual/sql-functions/json-functions/json_object.md b/docs/en/sql-manual/sql-functions/json-functions/json_object.md index 917f1723e81550..d21daf3b471b90 100644 --- a/docs/en/sql-manual/sql-functions/json-functions/json_object.md +++ b/docs/en/sql-manual/sql-functions/json-functions/json_object.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# json_object -## Description -### Syntax +## json_object +### Description +#### Syntax `VARCHAR json_object(VARCHAR,...)` @@ -34,7 +34,7 @@ under the License. Generate a json object containing the specified Key-Value, an exception error is returned when Key is NULL or the number of parameters are odd. -## example +### example ``` MySQL> select json_object(); @@ -67,5 +67,5 @@ MySQL> select json_object('username',null); | {"username": NULL} | +---------------------------------+ ``` -## keyword +### keywords json_object diff --git a/docs/en/sql-manual/sql-functions/json-functions/json_quote.md b/docs/en/sql-manual/sql-functions/json-functions/json_quote.md index e02168e1d75ae3..6cc120a16604bd 100644 --- a/docs/en/sql-manual/sql-functions/json-functions/json_quote.md +++ b/docs/en/sql-manual/sql-functions/json-functions/json_quote.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# json_quote -## Description -### Syntax +## json_quote +### Description +#### Syntax `VARCHAR json_quote(VARCHAR)` Enclose json_value in double quotes ("), escape special characters contained. -## example +### example ``` MySQL> SELECT json_quote('null'), json_quote('"null"'); @@ -66,5 +66,5 @@ MySQL> select json_quote("\n\b\r\t"); | "\n\b\r\t" | +------------------------+ ``` -## keyword +### keywords json_quote diff --git a/docs/en/sql-manual/sql-functions/math-functions/conv.md b/docs/en/sql-manual/sql-functions/math-functions/conv.md index 4ce1e1879c551a..40959465976417 100644 --- a/docs/en/sql-manual/sql-functions/math-functions/conv.md +++ b/docs/en/sql-manual/sql-functions/math-functions/conv.md @@ -22,16 +22,16 @@ specific language governing permissions and limitations under the License. --> -# conv +## conv -## description -### Syntax +### description +#### Syntax `VARCHAR CONV(VARCHAR input, TINYINT from_base, TINYINT to_base)` `VARCHAR CONV(BIGINT input, TINYINT from_base, TINYINT to_base)` Convert the input number to the target base. The input base range should be within `[2,36]`. -## example +### example ``` MySQL [test]> SELECT CONV(15,10,2); @@ -56,5 +56,5 @@ MySQL [test]> SELECT CONV(230,10,16); +-------------------+ ``` -## keyword +### keywords CONV diff --git a/docs/en/sql-manual/sql-functions/math-functions/pmod.md b/docs/en/sql-manual/sql-functions/math-functions/pmod.md index a9693a03c8e135..e986edea16936a 100644 --- a/docs/en/sql-manual/sql-functions/math-functions/pmod.md +++ b/docs/en/sql-manual/sql-functions/math-functions/pmod.md @@ -22,17 +22,17 @@ specific language governing permissions and limitations under the License. --> -# pmod +## pmod -## description -### Syntax +### description +#### Syntax `BIGINT PMOD(BIGINT x, BIGINT y)` `DOUBLE PMOD(DOUBLE x, DOUBLE y)` Returns the positive result of x mod y in the residue systems. Formally, return `(x%y+y)%y`. -## example +### example ``` MySQL [test]> SELECT PMOD(13,5); @@ -50,5 +50,5 @@ MySQL [test]> SELECT PMOD(-13,5); +-------------+ ``` -## keyword +### keywords PMOD diff --git a/docs/en/sql-manual/sql-functions/spatial-functions/st_astext.md b/docs/en/sql-manual/sql-functions/spatial-functions/st_astext.md index 15ddf61f077f60..1781d3139d1379 100644 --- a/docs/en/sql-manual/sql-functions/spatial-functions/st_astext.md +++ b/docs/en/sql-manual/sql-functions/spatial-functions/st_astext.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# `ST_AsText`,`ST_AsWKT` -## Description -### Syntax +## `ST_AsText`,`ST_AsWKT` +### Description +#### Syntax `VARCHAR ST_AsText (GEOMETRY geo)` Converting a geometric figure into a WKT (Well Known Text) representation -## example +### example ``` mysql> SELECT ST_AsText(ST_Point(24.7, 56.7)); @@ -43,5 +43,5 @@ mysql> SELECT ST_AsText(ST_Point(24.7, 56.7)); | POINT (24.7 56.7) | +---------------------------------+ ``` -## keyword +### keywords ST_ASTEXT,ST_ASWKT,ST,ASTEXT,ASWKT diff --git a/docs/en/sql-manual/sql-functions/spatial-functions/st_circle.md b/docs/en/sql-manual/sql-functions/spatial-functions/st_circle.md index a7b8df01234848..d5a6471a268f60 100644 --- a/docs/en/sql-manual/sql-functions/spatial-functions/st_circle.md +++ b/docs/en/sql-manual/sql-functions/spatial-functions/st_circle.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# `ST_Circle` -## Description -### Syntax +## `ST_Circle` +### Description +#### Syntax `GEOMETRY ST_Circle(DOUBLE center_lng, DOUBLE center_lat, DOUBLE radius)` @@ -34,7 +34,7 @@ under the License. Convert a WKT (Well Known Text) into a circle on the earth's sphere. Where `center_lng'denotes the longitude of the center of a circle, ` Center_lat` denotes the latitude of the center of a circle, radius` denotes the radius of a circle in meters. -## example +### example ``` mysql> SELECT ST_AsText(ST_Circle(111, 64, 10000)); @@ -44,5 +44,5 @@ mysql> SELECT ST_AsText(ST_Circle(111, 64, 10000)); | CIRCLE ((111 64), 10000) | +--------------------------------------------+ ``` -## keyword +### keywords ST_CIRCLE,ST,CIRCLE diff --git a/docs/en/sql-manual/sql-functions/spatial-functions/st_contains.md b/docs/en/sql-manual/sql-functions/spatial-functions/st_contains.md index eedaa0ee8347e2..61b19d49c442f3 100644 --- a/docs/en/sql-manual/sql-functions/spatial-functions/st_contains.md +++ b/docs/en/sql-manual/sql-functions/spatial-functions/st_contains.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# `ST_Contains' -## Description -### Syntax +## `ST_Contains' +### Description +#### Syntax `BOOL ST_Contains(GEOMETRY shape1, GEOMETRY shape2)` Judging whether geometric shape 1 can contain geometric shape 2 completely -## example +### example ``` @@ -51,6 +51,6 @@ mysql> SELECT ST_Contains(ST_Polygon("POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))"), | 0 | +------------------------------------------------------------------------------------------+ ``` -## keyword +### keywords ST_CONTAINS,ST,CONTAINS w \ No newline at end of file diff --git a/docs/en/sql-manual/sql-functions/spatial-functions/st_distance_sphere.md b/docs/en/sql-manual/sql-functions/spatial-functions/st_distance_sphere.md index cce4fbd894cb0c..ee7ad24d5ba77e 100644 --- a/docs/en/sql-manual/sql-functions/spatial-functions/st_distance_sphere.md +++ b/docs/en/sql-manual/sql-functions/spatial-functions/st_distance_sphere.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# `ST_Distance_Sphere` -## description -### Syntax +## `ST_Distance_Sphere` +### description +#### Syntax `DOUBLE ST_Distance_Sphere(DOUBLE x_lng, DOUBLE x_lat, DOUBLE y_lng, DOUBLE x_lat)` Calculate the spherical distance between two points of the earth in meters. The incoming parameters are the longitude of point X, the latitude of point X, the longitude of point Y and the latitude of point Y. -## example +### example ``` mysql> select st_distance_sphere(116.35620117, 39.939093, 116.4274406433, 39.9020987219); @@ -43,5 +43,5 @@ mysql> select st_distance_sphere(116.35620117, 39.939093, 116.4274406433, 39.902 | 7336.9135549995917 | +----------------------------------------------------------------------------+ ``` -## keyword +### keywords ST_DISTANCE_SPHERE,ST,DISTANCE,SPHERE diff --git a/docs/en/sql-manual/sql-functions/spatial-functions/st_geometryfromtext.md b/docs/en/sql-manual/sql-functions/spatial-functions/st_geometryfromtext.md index 49c67ab70dc0c7..896ee58c389d0f 100644 --- a/docs/en/sql-manual/sql-functions/spatial-functions/st_geometryfromtext.md +++ b/docs/en/sql-manual/sql-functions/spatial-functions/st_geometryfromtext.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# `ST_GeometryFromText`,`ST GeomFromText` -## Description -### Syntax +## `ST_GeometryFromText`,`ST GeomFromText` +### Description +#### Syntax `GEOMETRY ST_GeometryFromText (VARCHAR wkt)` Converting a WKT (Well Known Text) into a corresponding memory geometry -## example +### example ``` mysql> SELECT ST_AsText(ST_GeometryFromText("LINESTRING (1 1, 2 2)")); @@ -43,5 +43,5 @@ mysql> SELECT ST_AsText(ST_GeometryFromText("LINESTRING (1 1, 2 2)")); | LINESTRING (1 1, 2 2) | +---------------------------------------------------------+ ``` -## keyword +### keywords ST_GEOMETRYFROMTEXT,ST_GEOMFROMTEXT,ST,GEOMETRYFROMTEXT,GEOMFROMTEXT diff --git a/docs/en/sql-manual/sql-functions/spatial-functions/st_linefromtext.md b/docs/en/sql-manual/sql-functions/spatial-functions/st_linefromtext.md index 1d232ccbfccd6f..4ebcb4d2f5646f 100644 --- a/docs/en/sql-manual/sql-functions/spatial-functions/st_linefromtext.md +++ b/docs/en/sql-manual/sql-functions/spatial-functions/st_linefromtext.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# `ST_LineFromText`,`ST_LineStringFromText` -## Description -### Syntax +## `ST_LineFromText`,`ST_LineStringFromText` +### Description +#### Syntax `GEOMETRY ST LineFromText (VARCHAR wkt)` Converting a WKT (Well Known Text) into a Line-style memory representation -## example +### example ``` mysql> SELECT ST_AsText(ST_LineFromText("LINESTRING (1 1, 2 2)")); @@ -43,5 +43,5 @@ mysql> SELECT ST_AsText(ST_LineFromText("LINESTRING (1 1, 2 2)")); | LINESTRING (1 1, 2 2) | +---------------------------------------------------------+ ``` -## keyword +### keywords ST_LINEFROMTEXT, ST_LINESTRINGFROMTEXT,ST,LINEFROMTEXT,LINESTRINGFROMTEXT diff --git a/docs/en/sql-manual/sql-functions/spatial-functions/st_point.md b/docs/en/sql-manual/sql-functions/spatial-functions/st_point.md index 00caf5c90cf45f..229c3c5022db35 100644 --- a/docs/en/sql-manual/sql-functions/spatial-functions/st_point.md +++ b/docs/en/sql-manual/sql-functions/spatial-functions/st_point.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# St_Point' -## Description -### Syntax +## St_Point' +### Description +#### Syntax `POINT ST_Point(DOUBLE x, DOUBLE y)` @@ -34,7 +34,7 @@ under the License. Given the X coordinate value, the Y coordinate value returns the corresponding Point. The current value is meaningful only for spherical sets, and X/Y corresponds to longitude/latitude. -## example +### example ``` mysql> SELECT ST_AsText(ST_Point(24.7, 56.7)); @@ -44,5 +44,5 @@ mysql> SELECT ST_AsText(ST_Point(24.7, 56.7)); | POINT (24.7 56.7) | +---------------------------------+ ``` -## keyword +### keywords ST_POINT,ST,POINT diff --git a/docs/en/sql-manual/sql-functions/spatial-functions/st_polygon.md b/docs/en/sql-manual/sql-functions/spatial-functions/st_polygon.md index 456b29e5c64ab5..652247d2bb88fe 100644 --- a/docs/en/sql-manual/sql-functions/spatial-functions/st_polygon.md +++ b/docs/en/sql-manual/sql-functions/spatial-functions/st_polygon.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# `ST_Polygon`,`ST_PolyFromText`,`ST_PolygonFromText` -## Description -### Syntax +## `ST_Polygon`,`ST_PolyFromText`,`ST_PolygonFromText` +### Description +#### Syntax `GEOMETRY ST_Polygon (VARCHAR wkt)` @@ -34,7 +34,7 @@ under the License. Converting a WKT (Well Known Text) into a corresponding polygon memory form -### example +#### example ``` mysql> SELECT ST_AsText(ST_Polygon("POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))")); @@ -44,5 +44,5 @@ mysql> SELECT ST_AsText(ST_Polygon("POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))")); | POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0)) | +------------------------------------------------------------------+ ``` -## keyword +### keywords ST_POLYGON,ST_POLYFROMTEXT,ST_POLYGONFROMTEXT,ST,POLYGON,POLYFROMTEXT,POLYGONFROMTEXT diff --git a/docs/en/sql-manual/sql-functions/spatial-functions/st_x.md b/docs/en/sql-manual/sql-functions/spatial-functions/st_x.md index 86d7e4a8008da9..5a0ec089f9281e 100644 --- a/docs/en/sql-manual/sql-functions/spatial-functions/st_x.md +++ b/docs/en/sql-manual/sql-functions/spatial-functions/st_x.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# `ST_X` -## Description -### Syntax +## `ST_X` +### Description +#### Syntax `DOUBLE ST_X(POINT point)` When point is a valid POINT type, the corresponding X coordinate value is returned. -## example +### example ``` mysql> SELECT ST_X(ST_Point(24.7, 56.7)); @@ -43,5 +43,5 @@ mysql> SELECT ST_X(ST_Point(24.7, 56.7)); | 24.7 | +----------------------------+ ``` -## keyword +### keywords ST_X,ST,X diff --git a/docs/en/sql-manual/sql-functions/spatial-functions/st_y.md b/docs/en/sql-manual/sql-functions/spatial-functions/st_y.md index 7dcc7fe494a440..7cb69b5a94c528 100644 --- a/docs/en/sql-manual/sql-functions/spatial-functions/st_y.md +++ b/docs/en/sql-manual/sql-functions/spatial-functions/st_y.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# `ST_Y` -## Description -### Syntax +## `ST_Y` +### Description +#### Syntax `DOUBLE ST_Y(POINT point)` When point is a valid POINT type, the corresponding Y coordinate value is returned. -## example +### example ``` mysql> SELECT ST_Y(ST_Point(24.7, 56.7)); @@ -43,5 +43,5 @@ mysql> SELECT ST_Y(ST_Point(24.7, 56.7)); | 56.7 | +----------------------------+ ``` -## keyword +### keywords ST_Y,ST,Y diff --git a/docs/en/sql-manual/sql-functions/string-functions/append_trailing_char_if_absent.md b/docs/en/sql-manual/sql-functions/string-functions/append_trailing_char_if_absent.md index 6895c3e33cf5f3..616f418d3723ca 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/append_trailing_char_if_absent.md +++ b/docs/en/sql-manual/sql-functions/string-functions/append_trailing_char_if_absent.md @@ -24,18 +24,18 @@ specific language governing permissions and limitations under the License. --> -# append_trailing_char_if_absent +## append_trailing_char_if_absent -## description +### description -### Syntax +#### Syntax `VARCHAR append_trailing_char_if_absent(VARCHAR str, VARCHAR trailing_char)` If the @str string is non-empty and does not contain the @trailing_char character at the end, it appends the @trailing_char character to the end. @trailing_char contains only one character, and it will return NULL if contains more than one character -## example +### example ``` MySQL [test]> select append_trailing_char_if_absent('a','c'); @@ -55,6 +55,6 @@ MySQL [test]> select append_trailing_char_if_absent('ac','c'); 1 row in set (0.00 sec) ``` -## keyword +### keywords APPEND_TRAILING_CHAR_IF_ABSENT diff --git a/docs/en/sql-manual/sql-functions/string-functions/ascii.md b/docs/en/sql-manual/sql-functions/string-functions/ascii.md index ba747f5adf932c..ef82da933b72f2 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/ascii.md +++ b/docs/en/sql-manual/sql-functions/string-functions/ascii.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# ASCII -## Description -### Syntax +## ASCII +### Description +#### Syntax `INT AXES (WARCHAR STR)` Returns the ASCII code corresponding to the first character of the string -## example +### example ``` mysql> select ascii('1'); @@ -50,5 +50,5 @@ mysql> select ascii('234'); | 50 | +--------------+ ``` -## keyword +### keywords ASCII diff --git a/docs/en/sql-manual/sql-functions/string-functions/bit_length.md b/docs/en/sql-manual/sql-functions/string-functions/bit_length.md index bb4d8f74368a4a..287c6fc97f4472 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/bit_length.md +++ b/docs/en/sql-manual/sql-functions/string-functions/bit_length.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# bit_length -## Description -### Syntax +## bit_length +### Description +#### Syntax `INT bit_length (VARCHAR str)` Return length of argument in bits. -## example +### example ``` mysql> select bit_length("abc"); @@ -50,5 +50,5 @@ mysql> select bit_length("中国"); | 48 | +----------------------+ ``` -## keyword +### keywords BIT_LENGTH diff --git a/docs/en/sql-manual/sql-functions/string-functions/char_length.md b/docs/en/sql-manual/sql-functions/string-functions/char_length.md index fbba1480c6d3b1..2af4a7b5d74039 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/char_length.md +++ b/docs/en/sql-manual/sql-functions/string-functions/char_length.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# char_length -## Description -### Syntax +## char_length +### Description +#### Syntax 'INT char_length (VARCHAR str)' Returns the length of the string, and the number of characters returned for multi-byte characters. For example, five two-byte width words return a length of 5, only utf8 encoding is support at the current version. `character_length` is the alias for this function. -## example +### example ``` @@ -51,5 +51,5 @@ mysql> select char_length("中国"); | 2 | +-----------------------+ ``` -## keyword +### keywords CHAR_LENGTH, CHARACTER_LENGTH diff --git a/docs/en/sql-manual/sql-functions/string-functions/concat.md b/docs/en/sql-manual/sql-functions/string-functions/concat.md index f167166fdfdd7a..f5a662e314e1a8 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/concat.md +++ b/docs/en/sql-manual/sql-functions/string-functions/concat.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# concat -## Description -### Syntax +## concat +### Description +#### Syntax `VARCHAR concat (VARCHAR,...)` Connect multiple strings and return NULL if any of the parameters is NULL -## example +### example ``` mysql> select concat("a", "b"); @@ -57,5 +57,5 @@ mysql> select concat("a", null, "c"); | NULL | +------------------------+ ``` -## keyword +### keywords CONCAT diff --git a/docs/en/sql-manual/sql-functions/string-functions/concat_ws.md b/docs/en/sql-manual/sql-functions/string-functions/concat_ws.md index 5b26138bb83d9f..d3b0cf5238acba 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/concat_ws.md +++ b/docs/en/sql-manual/sql-functions/string-functions/concat_ws.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# Concat_ws -## Description -### Syntax +## Concat_ws +### Description +#### Syntax `VARCHAR concat ws (VARCHAR sep., VARCHAR str,...)` @@ -35,7 +35,7 @@ Using the first parameter SEP as a connector, the second parameter and all subse If the separator is NULL, return NULL. ` The concat_ws` function does not skip empty strings, but NULL values. -## example +### example ``` mysql> select concat_ws("or", "d", "is"); @@ -59,5 +59,5 @@ mysql> select concat_ws("or", "d", NULL,"is"); | doris | +---------------------------------+ ``` -## keyword +### keywords CONCAT_WS,CONCAT,WS diff --git a/docs/en/sql-manual/sql-functions/string-functions/ends_with.md b/docs/en/sql-manual/sql-functions/string-functions/ends_with.md index 7df3e3490d45fa..38a297dc642bca 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/ends_with.md +++ b/docs/en/sql-manual/sql-functions/string-functions/ends_with.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# ends_with -## Description -### Syntax +## ends_with +### Description +#### Syntax `BOOLEAN ENDS_WITH (VARCHAR str, VARCHAR suffix)` It returns true if the string ends with the specified suffix, otherwise it returns false. If any parameter is NULL, it returns NULL. -## example +### example ``` mysql> select ends_with("Hello doris", "doris"); @@ -50,5 +50,5 @@ mysql> select ends_with("Hello doris", "Hello"); | 0 | +-----------------------------------+ ``` -## keyword +### keywords ENDS_WITH diff --git a/docs/en/sql-manual/sql-functions/string-functions/find_in_set.md b/docs/en/sql-manual/sql-functions/string-functions/find_in_set.md index c0bd4340413fbf..08eabc2a651fd5 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/find_in_set.md +++ b/docs/en/sql-manual/sql-functions/string-functions/find_in_set.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# find_in_set -## description -### Syntax +## find_in_set +### description +#### Syntax `INT find_in_set(VARCHAR str, VARCHAR strlist)` @@ -35,7 +35,7 @@ under the License. Return to the location where the str first appears in strlist (counting from 1). Strlist is a comma-separated string. If not, return 0. Any parameter is NULL, returning NULL. -## example +### example ``` mysql> select find_in_set("b", "a,b,c"); @@ -45,5 +45,5 @@ mysql> select find_in_set("b", "a,b,c"); | 2 | +---------------------------+ ``` -## keyword +### keywords FIND_IN_SET,FIND,IN,SET diff --git a/docs/en/sql-manual/sql-functions/string-functions/hex.md b/docs/en/sql-manual/sql-functions/string-functions/hex.md index cb58c0d2fa0e51..6a74fa3c4c8bd9 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/hex.md +++ b/docs/en/sql-manual/sql-functions/string-functions/hex.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# hex -## description -### Syntax +## hex +### description +#### Syntax `VARCHAR hex(VARCHAR str)` @@ -37,7 +37,7 @@ If the input parameter is a number, the string representation of the hexadecimal If the input parameter is a string, each character will be converted into two hexadecimal characters, and all the characters after the conversion will be spliced into a string for output -## example +### example ``` input string @@ -81,5 +81,5 @@ mysql> select hex(-1); | FFFFFFFFFFFFFFFF | +------------------+ ``` -## keyword +### keywords HEX diff --git a/docs/en/sql-manual/sql-functions/string-functions/instr.md b/docs/en/sql-manual/sql-functions/string-functions/instr.md index ef7b0dd77d8015..01132b84d7ff35 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/instr.md +++ b/docs/en/sql-manual/sql-functions/string-functions/instr.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# instr -## Description -### Syntax +## instr +### Description +#### Syntax `INSTR (VARCHAR STR, VARCHAR substrate)` Returns the location where substr first appeared in str (counting from 1). If substr does not appear in str, return 0. -## example +### example ``` mysql> select instr("abc", "b"); @@ -50,5 +50,5 @@ mysql> select instr("abc", "d"); | 0 | +-------------------+ ``` -## keyword +### keywords INSTR diff --git a/docs/en/sql-manual/sql-functions/string-functions/lcase.md b/docs/en/sql-manual/sql-functions/string-functions/lcase.md index f54ec03e9de446..48c295ee8564a9 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/lcase.md +++ b/docs/en/sql-manual/sql-functions/string-functions/lcase.md @@ -24,14 +24,14 @@ specific language governing permissions and limitations under the License. --> -# lcase -## Description -### Syntax +## lcase +### Description +#### Syntax `INT lcase (VARCHAR str)` Consistent with `lower`. -## keyword +### keywords LCASE diff --git a/docs/en/sql-manual/sql-functions/string-functions/left.md b/docs/en/sql-manual/sql-functions/string-functions/left.md index 4e807cb64c15df..88122b874ef6fd 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/left.md +++ b/docs/en/sql-manual/sql-functions/string-functions/left.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# left -## Description -### Syntax +## left +### Description +#### Syntax `VARCHAR left (VARCHAR str)` It returns the left part of a string of specified length, length is char length not the byte size. -## example +### example ``` mysql> select left("Hello doris",5); @@ -43,5 +43,5 @@ mysql> select left("Hello doris",5); | Hello | +------------------------+ ``` -## keyword +### keywords LEFT diff --git a/docs/en/sql-manual/sql-functions/string-functions/length.md b/docs/en/sql-manual/sql-functions/string-functions/length.md index 85f0a61b94f28a..7870b8cf156352 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/length.md +++ b/docs/en/sql-manual/sql-functions/string-functions/length.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# length -## Description -### Syntax +## length +### Description +#### Syntax `INT length (VARCHAR str)` Returns the length of the string in byte size. -## example +### example ``` mysql> select length("abc"); @@ -50,5 +50,5 @@ mysql> select length("中国"); | 6 | +------------------+ ``` -## keyword +### keywords LENGTH diff --git a/docs/en/sql-manual/sql-functions/string-functions/like/like.md b/docs/en/sql-manual/sql-functions/string-functions/like/like.md index 48affd6c875964..d357312c4ed7e9 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/like/like.md +++ b/docs/en/sql-manual/sql-functions/string-functions/like/like.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# like -## description -### syntax +## like +### description +#### syntax `BOOLEAN like(VARCHAR str, VARCHAR pattern)` @@ -48,7 +48,7 @@ the underscore ('_') represents a single character. 'a_' // two digits and the initial letter is a 'a__b' // four digits, starting letter is a and ending letter is b ``` -## example +### example ``` // table test @@ -79,5 +79,5 @@ mysql> select k1 from test where k1 like 'a'; +-------+ ``` -## keyword +### keywords LIKE diff --git a/docs/en/sql-manual/sql-functions/string-functions/like/not_like.md b/docs/en/sql-manual/sql-functions/string-functions/like/not_like.md index 3ac280ff14ef6e..2d3e8462304015 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/like/not_like.md +++ b/docs/en/sql-manual/sql-functions/string-functions/like/not_like.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# not like -## description -### syntax +## not like +### description +#### syntax `BOOLEAN not like(VARCHAR str, VARCHAR pattern)` @@ -48,7 +48,7 @@ the underscore ('_') represents a single character. 'a_' // two digits and the initial letter is a 'a__b' // four digits, starting letter is a and ending letter is b ``` -## example +### example ``` // table test @@ -81,5 +81,5 @@ mysql> select k1 from test where k1 not like 'a'; +-------+ ``` -## keyword +### keywords LIKE, NOT, NOT LIKE diff --git a/docs/en/sql-manual/sql-functions/string-functions/locate.md b/docs/en/sql-manual/sql-functions/string-functions/locate.md index 92a169a27277e2..aa99d7423a6723 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/locate.md +++ b/docs/en/sql-manual/sql-functions/string-functions/locate.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# locate -## Description -### Syntax +## locate +### Description +#### Syntax `INT LOCATION (VARCHAR substrate, VARCHAR str [, INT pos]]` Returns where substr appears in str (counting from 1). If the third parameter POS is specified, the position where substr appears is found from the string where STR starts with POS subscript. If not found, return 0 -## example +### example ``` mysql> SELECT LOCATE('bar', 'foobarbar'); @@ -57,5 +57,5 @@ mysql> SELECT LOCATE('bar', 'foobarbar', 5); | 7 | +-------------------------------+ ``` -## keyword +### keywords LOCATE diff --git a/docs/en/sql-manual/sql-functions/string-functions/lower.md b/docs/en/sql-manual/sql-functions/string-functions/lower.md index db094008b2c947..f85cf4a2c58859 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/lower.md +++ b/docs/en/sql-manual/sql-functions/string-functions/lower.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# lower -## Description -### Syntax +## lower +### Description +#### Syntax `INT lower (VARCHAR str)` Convert all strings in parameters to lowercase -## example +### example ``` mysql> SELECT lower("AbC123"); @@ -43,5 +43,5 @@ mysql> SELECT lower("AbC123"); | abc123 | +-----------------+ ``` -## keyword +### keywords LOWER diff --git a/docs/en/sql-manual/sql-functions/string-functions/lpad.md b/docs/en/sql-manual/sql-functions/string-functions/lpad.md index c2a8b095de4495..50f3d679a634a0 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/lpad.md +++ b/docs/en/sql-manual/sql-functions/string-functions/lpad.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# lpad -## Description -### Syntax +## lpad +### Description +#### Syntax `VARCHAR lpad (VARCHAR str, INT len, VARCHAR pad)` Returns a string of length len in str, starting with the initials. If len is longer than str, pad characters are added to STR until the length of the string reaches len. If len is less than str's length, the function is equivalent to truncating STR strings and returning only strings of len's length. The len is character length not the bye size. -## example +### example ``` mysql> SELECT lpad("hi", 5, "xy"); @@ -50,5 +50,5 @@ mysql> SELECT lpad("hi", 1, "xy"); | h | +---------------------+ ``` -## keyword +### keywords LPAD diff --git a/docs/en/sql-manual/sql-functions/string-functions/ltrim.md b/docs/en/sql-manual/sql-functions/string-functions/ltrim.md index 5e4f7bf2df4e1c..1c1fb218f46176 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/ltrim.md +++ b/docs/en/sql-manual/sql-functions/string-functions/ltrim.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# ltrim -## Description -### Syntax +## ltrim +### Description +#### Syntax `VARCHAR ltrim (VARCHAR str)` Remove the space that appears continuously from the beginning of the parameter str -## example +### example ``` mysql> SELECT ltrim(' ab d'); @@ -43,5 +43,5 @@ mysql> SELECT ltrim(' ab d'); | ab d | +------------------+ ``` -## keyword +### keywords LTRIM diff --git a/docs/en/sql-manual/sql-functions/string-functions/money_format.md b/docs/en/sql-manual/sql-functions/string-functions/money_format.md index 541e8fbe2016fd..f4f6c4730799ce 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/money_format.md +++ b/docs/en/sql-manual/sql-functions/string-functions/money_format.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# money_format -## Description -### Syntax +## money_format +### Description +#### Syntax `VARCHAR money format (Number)` The number is output in currency format, the integer part is separated by commas every three bits, and the decimal part is reserved for two bits. -## example +### example ``` mysql> select money_format(17014116); @@ -57,5 +57,5 @@ mysql> select money_format(1123.4); | 1,123.40 | +----------------------+ ``` -## keyword +### keywords MONEY_FORMAT,MONEY,FORMAT diff --git a/docs/en/sql-manual/sql-functions/string-functions/null_or_empty.md b/docs/en/sql-manual/sql-functions/string-functions/null_or_empty.md index 89cb22bc391654..0c0d5d46d8a925 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/null_or_empty.md +++ b/docs/en/sql-manual/sql-functions/string-functions/null_or_empty.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# null_or_empty -## description -### Syntax +## null_or_empty +### description +#### Syntax `BOOLEAN NULL_OR_EMPTY (VARCHAR str)` It returns true if the string is an empty string or NULL. Otherwise it returns false. -## example +### example ``` MySQL [(none)]> select null_or_empty(null); @@ -56,5 +56,5 @@ MySQL [(none)]> select null_or_empty("a"); | 0 | +--------------------+ ``` -## keyword +### keywords NULL_OR_EMPTY \ No newline at end of file diff --git a/docs/en/sql-manual/sql-functions/string-functions/regexp/not_regexp.md b/docs/en/sql-manual/sql-functions/string-functions/regexp/not_regexp.md index 400138736ad595..ca2e19f4b8b893 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/regexp/not_regexp.md +++ b/docs/en/sql-manual/sql-functions/string-functions/regexp/not_regexp.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the license. --> -# not regexp -## description -### syntax +## not regexp +### description +#### syntax `BOOLEAN not regexp(VARCHAR str, VARCHAR pattern)` Perform regular matching on the string str, return false if it matches, and return true if it doesn't match. pattern is a regular expression. -## example +### example ``` // Find all data in the k1 field that does not start with 'billie' @@ -52,5 +52,5 @@ mysql> select k1 from test where k1 not regexp 'ok$'; +------------+ ``` -## keyword +### keywords REGEXP, NOT, NOT REGEXP diff --git a/docs/en/sql-manual/sql-functions/string-functions/regexp/regexp.md b/docs/en/sql-manual/sql-functions/string-functions/regexp/regexp.md index f45f9e48a38d28..41a1a239f8e767 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/regexp/regexp.md +++ b/docs/en/sql-manual/sql-functions/string-functions/regexp/regexp.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# regexp -## description -### syntax +## regexp +### description +#### syntax `BOOLEAN regexp(VARCHAR str, VARCHAR pattern)` Perform regular matching on the string str, return true if it matches, and return false if it doesn't match. pattern is a regular expression. -## example +### example ``` // Find all data starting with 'billie' in the k1 field @@ -52,5 +52,5 @@ mysql> select k1 from test where k1 regexp 'ok$'; +----------+ ``` -## keyword +### keywords REGEXP diff --git a/docs/en/sql-manual/sql-functions/string-functions/regexp/regexp_extract.md b/docs/en/sql-manual/sql-functions/string-functions/regexp/regexp_extract.md index 5e35b5567844ed..814605beca51c1 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/regexp/regexp_extract.md +++ b/docs/en/sql-manual/sql-functions/string-functions/regexp/regexp_extract.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# regexp_extract -## Description -### Syntax +## regexp_extract +### Description +#### Syntax 'VARCHAR regexp 'extract (VARCHAR str, VARCHAR pattern, int pos) The string STR is matched regularly and the POS matching part which conforms to pattern is extracted. Patterns need to match exactly some part of the STR to return to the matching part of the pattern. If there is no match, return an empty string. -## example +### example ``` mysql> SELECT regexp_extract('AbCdE', '([[:lower:]]+)C([[:lower:]]+)', 1); @@ -50,5 +50,5 @@ mysql> SELECT regexp_extract('AbCdE', '([[:lower:]]+)C([[:lower:]]+)', 2); | d | +-------------------------------------------------------------+ ``` -## keyword +### keywords REGEXP_EXTRACT,REGEXP,EXTRACT diff --git a/docs/en/sql-manual/sql-functions/string-functions/regexp/regexp_replace.md b/docs/en/sql-manual/sql-functions/string-functions/regexp/regexp_replace.md index c7524dd4e388d7..e9b611f649769f 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/regexp/regexp_replace.md +++ b/docs/en/sql-manual/sql-functions/string-functions/regexp/regexp_replace.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# regexp_replace -## description -### Syntax +## regexp_replace +### description +#### Syntax `VARCHAR regexp_replace(VARCHAR str, VARCHAR pattern, VARCHAR repl)` Regular matching of STR strings, replacing the part hitting pattern with repl -## example +### example ``` mysql> SELECT regexp_replace('a b c', " ", "-"); @@ -50,5 +50,5 @@ mysql> SELECT regexp_replace('a b c','(b)','<\\1>'); | a c | +----------------------------------------+ ``` -## keyword +### keywords REGEXP_REPLACE,REGEXP,REPLACE diff --git a/docs/en/sql-manual/sql-functions/string-functions/repeat.md b/docs/en/sql-manual/sql-functions/string-functions/repeat.md index 142747cbe17ccd..ada0b7b3eb8959 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/repeat.md +++ b/docs/en/sql-manual/sql-functions/string-functions/repeat.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# repeat -## Description -### Syntax +## repeat +### Description +#### Syntax `VARCHAR repeat (VARCHAR str, INT count)` Repeat the str of the string count times, return empty string when count is less than 1, return NULL when str, count is any NULL -## example +### example ``` mysql> SELECT repeat("a", 3); @@ -50,5 +50,5 @@ mysql> SELECT repeat("a", -1); | | +-----------------+ ``` -## keyword +### keywords REPEAT, diff --git a/docs/en/sql-manual/sql-functions/string-functions/replace.md b/docs/en/sql-manual/sql-functions/string-functions/replace.md index d5111fa43c8077..b9946bf83b90f0 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/replace.md +++ b/docs/en/sql-manual/sql-functions/string-functions/replace.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# replace -## description -### Syntax +## replace +### description +#### Syntax `VARCHAR REPLACE (VARCHAR str, VARCHAR old, VARCHAR new)` replace all old substring with new substring in str -## example +### example ``` mysql> select replace("http://www.baidu.com:9090", "9090", ""); @@ -42,5 +42,5 @@ mysql> select replace("http://www.baidu.com:9090", "9090", ""); | http://www.baidu.com: | +------------------------------------------------------+ ``` -## keyword +### keywords REPLACE diff --git a/docs/en/sql-manual/sql-functions/string-functions/reverse.md b/docs/en/sql-manual/sql-functions/string-functions/reverse.md index 7118e748ebf25f..f1a3964585279a 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/reverse.md +++ b/docs/en/sql-manual/sql-functions/string-functions/reverse.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# reverse -## description -### Syntax +## reverse +### description +#### Syntax `VARCHAR reverse(VARCHAR str)` The REVERSE() function reverses a string and returns the result. -## example +### example ``` mysql> SELECT REVERSE('hello'); @@ -52,5 +52,5 @@ mysql> SELECT REVERSE('你好'); +------------------+ 1 row in set (0.00 sec) ``` -## keyword +### keywords REVERSE diff --git a/docs/en/sql-manual/sql-functions/string-functions/right.md b/docs/en/sql-manual/sql-functions/string-functions/right.md index 04b6898788db03..506949d6d861ef 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/right.md +++ b/docs/en/sql-manual/sql-functions/string-functions/right.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# right -## Description -### Syntax +## right +### Description +#### Syntax `VARCHAR RIGHT (VARCHAR STR)` It returns the right part of a string of specified length, length is char length not the byte size. -## example +### example ``` mysql> select right("Hello doris",5); @@ -43,5 +43,5 @@ mysql> select right("Hello doris",5); | doris | +-------------------------+ ``` -## keyword +### keywords RIGHT diff --git a/docs/en/sql-manual/sql-functions/string-functions/rpad.md b/docs/en/sql-manual/sql-functions/string-functions/rpad.md index 3752b631a86bae..ffd97f5337c046 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/rpad.md +++ b/docs/en/sql-manual/sql-functions/string-functions/rpad.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# rpad -## Description -### Syntax +## rpad +### Description +#### Syntax `VARCHAR rpad (VARCHAR str, INT len, VARCHAR pad)` Returns a string of length len in str, starting with the initials. If len is longer than str, pad characters are added to the right of STR until the length of the string reaches len. If len is less than str's length, the function is equivalent to truncating STR strings and returning only strings of len's length. The len is character length not the bye size. -## example +### example ``` mysql> SELECT rpad("hi", 5, "xy"); @@ -50,5 +50,5 @@ mysql> SELECT rpad("hi", 1, "xy"); | h | +---------------------+ ``` -## keyword +### keywords RPAD diff --git a/docs/en/sql-manual/sql-functions/string-functions/split_part.md b/docs/en/sql-manual/sql-functions/string-functions/split_part.md index 6df62b5068771d..3261ca9082c87e 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/split_part.md +++ b/docs/en/sql-manual/sql-functions/string-functions/split_part.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# split_part -## Description -### Syntax +## split_part +### Description +#### Syntax `VARCHAR split party (VARCHAR content, VARCHAR delimiter, INT field)` Returns the specified partition (counting from the beginning) by splitting the string according to the partitioner. -## example +### example ``` mysql> select split_part("hello world", " ", 1); @@ -65,5 +65,5 @@ mysql> select split_part("abca", "a", 1); | | +----------------------------+ ``` -## keyword +### keywords SPLIT_PART,SPLIT,PART diff --git a/docs/en/sql-manual/sql-functions/string-functions/starts_with.md b/docs/en/sql-manual/sql-functions/string-functions/starts_with.md index c2b6d221849d8e..10fbf1c40bd9c9 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/starts_with.md +++ b/docs/en/sql-manual/sql-functions/string-functions/starts_with.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# starts_with -## Description -### Syntax +## starts_with +### Description +#### Syntax `BOOLEAN STARTS_WITH (VARCHAR str, VARCHAR prefix)` It returns true if the string starts with the specified prefix, otherwise it returns false. If any parameter is NULL, it returns NULL. -## example +### example ``` MySQL [(none)]> select starts_with("hello world","hello"); @@ -50,5 +50,5 @@ MySQL [(none)]> select starts_with("hello world","world"); | 0 | +-------------------------------------+ ``` -## keyword +### keywords STARTS_WITH \ No newline at end of file diff --git a/docs/en/sql-manual/sql-functions/string-functions/strleft.md b/docs/en/sql-manual/sql-functions/string-functions/strleft.md index 5c158d84117245..4049b4d892f366 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/strleft.md +++ b/docs/en/sql-manual/sql-functions/string-functions/strleft.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# strleft -## Description -### Syntax +## strleft +### Description +#### Syntax `VARCHAR STRAIGHT (VARCHAR STR)` It returns the left part of a string of specified length, length is char length not the byte size. -## example +### example ``` mysql> select strleft("Hello doris",5); @@ -43,5 +43,5 @@ mysql> select strleft("Hello doris",5); | Hello | +------------------------+ ``` -## keyword +### keywords STRLEFT diff --git a/docs/en/sql-manual/sql-functions/string-functions/strright.md b/docs/en/sql-manual/sql-functions/string-functions/strright.md index a71fb88f35f473..49d08851f3b1ac 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/strright.md +++ b/docs/en/sql-manual/sql-functions/string-functions/strright.md @@ -25,16 +25,16 @@ under the License. --> -# strright -## Description -### Syntax +## strright +### Description +#### Syntax `VARCHAR strright (VARCHAR str)` It returns the right part of a string of specified length, length is char length not the byte size. -## example +### example ``` mysql> select strright("Hello doris",5); @@ -44,5 +44,5 @@ mysql> select strright("Hello doris",5); | doris | +-------------------------+ ``` -## keyword +### keywords STRRIGHT diff --git a/docs/en/sql-manual/sql-functions/string-functions/substring.md b/docs/en/sql-manual/sql-functions/string-functions/substring.md index 66f7b886b66058..49cf21f0818236 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/substring.md +++ b/docs/en/sql-manual/sql-functions/string-functions/substring.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# substring -## description -### Syntax +## substring +### description +#### Syntax `VARCHAR substring(VARCHAR str, INT pos[, INT len])` @@ -41,7 +41,7 @@ For all forms of SUBSTRING(), the position of the first character in the string from which the substring is to be extracted is reckoned as 1. If len is less than 1, the result is the empty string. -## example +### example ``` mysql> select substring('abc1', -2); @@ -73,5 +73,5 @@ mysql> select substring('abc1def', 2, 2); +-----------------------------+ ``` -## keyword +### keywords SUBSTRING diff --git a/docs/en/sql-manual/sql-functions/string-functions/unhex.md b/docs/en/sql-manual/sql-functions/string-functions/unhex.md index eba746e1ba5bd3..8c0f5266c0dbb3 100644 --- a/docs/en/sql-manual/sql-functions/string-functions/unhex.md +++ b/docs/en/sql-manual/sql-functions/string-functions/unhex.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# unhex -## description -### Syntax +## unhex +### description +#### Syntax `VARCHAR unhex(VARCHAR str)` @@ -35,7 +35,7 @@ If the string contains characters other than `[0-9], [a-z], [A-Z]`, an empty str In other cases, every two characters are a group of characters converted into hexadecimal, and then spliced into a string for output. -## example +### example ``` mysql> select unhex('@'); @@ -59,5 +59,5 @@ mysql> select unhex('4142'); | AB | +---------------+ ``` -## keyword +### keywords UNHEX diff --git a/docs/en/sql-manual/sql-functions/table-functions/explode-bitmap.md b/docs/en/sql-manual/sql-functions/table-functions/explode-bitmap.md index 8863928b4794d2..99c2627a0b020b 100644 --- a/docs/en/sql-manual/sql-functions/table-functions/explode-bitmap.md +++ b/docs/en/sql-manual/sql-functions/table-functions/explode-bitmap.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# explode_bitmap +## explode_bitmap -## description +### description Table functions must be used in conjunction with Lateral View. @@ -38,7 +38,7 @@ grammar: explode_bitmap(bitmap) ``` -## example +### example Original table data: @@ -152,6 +152,6 @@ lateral view explode_split("a,b", ",") tmp2 as e2 order by k1, e1, e2; +------+------+------+ ``` -## keyword +### keywords explode_bitmap \ No newline at end of file diff --git a/docs/en/sql-manual/sql-functions/table-functions/explode-json-array.md b/docs/en/sql-manual/sql-functions/table-functions/explode-json-array.md index e9c136dbff17fb..d4b98216a57e49 100644 --- a/docs/en/sql-manual/sql-functions/table-functions/explode-json-array.md +++ b/docs/en/sql-manual/sql-functions/table-functions/explode-json-array.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# `explode_json_array` +## `explode_json_array` -## description +### description Table functions must be used in conjunction with Lateral View. @@ -40,7 +40,7 @@ explode_json_array_double(json_str) explode_json_array_string(json_str) ``` -## example +### example Original table data: @@ -281,6 +281,6 @@ mysql> select k1, e1 from example1 lateral view explode_json_array_string('{"a": +------+------+ ``` -## keyword +### keywords explode_json_array \ No newline at end of file diff --git a/docs/en/sql-manual/sql-functions/table-functions/explode-numbers.md b/docs/en/sql-manual/sql-functions/table-functions/explode-numbers.md index 6d959e8618272f..486060c574df93 100644 --- a/docs/en/sql-manual/sql-functions/table-functions/explode-numbers.md +++ b/docs/en/sql-manual/sql-functions/table-functions/explode-numbers.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# explode_numbers +## explode_numbers -## description +### description Table functions must be used in conjunction with Lateral View. @@ -38,7 +38,7 @@ grammar: explode_numbers(n) ``` -## example +### example ``` mysql> select e1 from (select 1 k1) as t lateral view explode_numbers(5) tmp1 as e1; +------+ @@ -51,6 +51,6 @@ mysql> select e1 from (select 1 k1) as t lateral view explode_numbers(5) tmp1 as | 4 | +------+ ``` -## keyword +### keywords explode_numbers \ No newline at end of file diff --git a/docs/en/sql-manual/sql-functions/table-functions/explode-split.md b/docs/en/sql-manual/sql-functions/table-functions/explode-split.md index 0557b900128905..fa4c2906cc1323 100644 --- a/docs/en/sql-manual/sql-functions/table-functions/explode-split.md +++ b/docs/en/sql-manual/sql-functions/table-functions/explode-split.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# explode_split +## explode_split -## description +### description Table functions must be used in conjunction with Lateral View. @@ -38,7 +38,7 @@ grammar: explode_split(str, delimiter) ``` -## example +### example Original table data: @@ -107,6 +107,6 @@ mysql> select k1, e1 from example1 lateral view explode_split(k2, ',') tmp1 as e +------+------+ ``` -## keyword +### keywords explode_split \ No newline at end of file diff --git a/docs/en/sql-manual/sql-functions/table-functions/outer-combinator.md b/docs/en/sql-manual/sql-functions/table-functions/outer-combinator.md index 83bed087d93740..8f86acc53b30b2 100644 --- a/docs/en/sql-manual/sql-functions/table-functions/outer-combinator.md +++ b/docs/en/sql-manual/sql-functions/table-functions/outer-combinator.md @@ -24,13 +24,13 @@ specific language governing permissions and limitations under the License. --> -# outer combinator +## outer combinator -## description +### description Adding the `_outer` suffix after the function name of the table function changes the function behavior from `non-outer` to `outer`, and adds a row of `Null` data when the table function generates 0 rows of data. -## example +### example ``` mysql> select e1 from (select 1 k1) as t lateral view explode_numbers(0) tmp1 as e1; @@ -43,6 +43,6 @@ mysql> select e1 from (select 1 k1) as t lateral view explode_numbers_outer(0) t | NULL | +------+ ``` -## keyword +### keywords outer \ No newline at end of file diff --git a/docs/en/sql-manual/sql-functions/window-function.md b/docs/en/sql-manual/sql-functions/window-function.md deleted file mode 100644 index c2abeb9337bd8f..00000000000000 --- a/docs/en/sql-manual/sql-functions/window-function.md +++ /dev/null @@ -1,487 +0,0 @@ ---- -{ - "title": "window function", - "language": "en" -} ---- - - - -# Doris Window function usage - -## Window function introduction - -Analysis functions are a special kind of built-in functions. Similar to the aggregation function, the analysis function also calculates a data value for multiple input rows. The difference is that the analysis function processes the input data in a specific window instead of grouping calculations according to group by. The data in each window can be sorted and grouped using the over() clause. The analysis function calculates a separate value for each row of the result set, instead of calculating a value for each group by group. This flexible way allows users to add additional columns in the select clause, giving users more opportunities to reorganize and filter the result set. Analysis functions can only appear in the select list and the outermost order by clause. In the query process, the analysis function will take effect at the end, that is, it will be executed after the join, where and group by operations are completed. Analytical functions are often used in the fields of finance and scientific computing to analyze trends, calculate outliers, and perform bucket analysis on large amounts of data. - -The syntax of the analysis function: - -```sql -function(args) OVER(partition_by_clause order_by_clause [window_clause]) -partition_by_clause ::= PARTITION BY expr [, expr ...] -order_by_clause ::= ORDER BY expr [ASC | DESC] [, expr [ASC | DESC] ...] -``` - -### Function - -Currently supported functions include AVG(), COUNT(), DENSE_RANK(), FIRST_VALUE(), LAG(), LAST_VALUE(), LEAD(), MAX(), MIN(), RANK(), ROW_NUMBER() and SUM (). - -### Partition By clause - -The Partition By clause is similar to Group By. It groups the input rows according to the specified one or more columns, and rows with the same value will be grouped into a group. - -### Order By clause - -The Order By clause is basically the same as the outer Order By. It defines the order of the input rows. If Partition By is specified, Order By defines the order within each Partition group. The only difference with the outer Order By is that the Order By n (n is a positive integer) in the OVER clause is equivalent to doing nothing, while the outer Order By n means sorting according to the nth column. - -For example: - -This example shows the addition of an id column to the select list, its value is 1, 2, 3, etc., in order according to the date_and_time column in the events table. - -```sql -SELECT -row_number() OVER (ORDER BY date_and_time) AS id, -c1, c2, c3, c4 -FROM events; -``` - -### Window clause - -The Window clause is used to specify an operation range for the analysis function, based on the current behavior, and several lines before and after the analysis function as the object of operation. The methods supported by the Window clause are: AVG(), COUNT(), FIRST_VALUE(), LAST_VALUE() and SUM(). For MAX() and MIN(), the window clause can specify the start range UNBOUNDED PRECEDING - -grammar: - -```sql -ROWS BETWEEN [ { m | UNBOUNDED } PRECEDING | CURRENT ROW] [ AND [CURRENT ROW | { UNBOUNDED | n } FOLLOWING] ] -``` - -### Example: - -Suppose we have the following stock data, the stock code is JDR, and the closing price is the daily closing price. - -```sql -create table stock_ticker (stock_symbol string, closing_price decimal(8,2), closing_date timestamp); -...load some data... -select * from stock_ticker order by stock_symbol, closing_date - | stock_symbol | closing_price | closing_date | - |--------------|---------------|---------------------| - | JDR | 12.86 | 2014-10-02 00:00:00 | - | JDR | 12.89 | 2014-10-03 00:00:00 | - | JDR | 12.94 | 2014-10-04 00:00:00 | - | JDR | 12.55 | 2014-10-05 00:00:00 | - | JDR | 14.03 | 2014-10-06 00:00:00 | - | JDR | 14.75 | 2014-10-07 00:00:00 | - | JDR | 13.98 | 2014-10-08 00:00:00 | -``` - -This query uses an analytical function to generate the moving_average column, and its value is the average price of stocks in 3 days, that is, the average price of the previous day, the current day, and the next day. The first day does not have the value of the previous day, and the last day does not have the value of the next day, so these two rows only calculate the average of the two days. Here Partition By does not play a role, because all the data is JDR data, but if there is other stock information, Partition By will ensure that the analysis function value is applied to this Partition. - -```sql -select stock_symbol, closing_date, closing_price, -avg(closing_price) over (partition by stock_symbol order by closing_date -rows between 1 preceding and 1 following) as moving_average -from stock_ticker; - | stock_symbol | closing_date | closing_price | moving_average | - |--------------|---------------------|---------------|----------------| - | JDR | 2014-10-02 00:00:00 | 12.86 | 12.87 | - | JDR | 2014-10-03 00:00:00 | 12.89 | 12.89 | - | JDR | 2014-10-04 00:00:00 | 12.94 | 12.79 | - | JDR | 2014-10-05 00:00:00 | 12.55 | 13.17 | - | JDR | 2014-10-06 00:00:00 | 14.03 | 13.77 | - | JDR | 2014-10-07 00:00:00 | 14.75 | 14.25 | - | JDR | 2014-10-08 00:00:00 | 13.98 | 14.36 | -``` - -## Function example - -This section introduces the methods that can be used as analysis functions in Doris. - -### AVG() - -grammar: - -```sql -AVG([DISTINCT | ALL] *expression*) [OVER (*analytic_clause*)] -``` - -For example: - -Calculate the x average value of the current row and each row of data before and after it. - -```sql -select x, property, -avg(x) over -( -partition by property -order by x -rows between 1 preceding and 1 following -) as 'moving average' -from int_t where property in ('odd','even'); - | x | property | moving average | - |----|----------|----------------| - | 2 | even | 3 | - | 4 | even | 4 | - | 6 | even | 6 | - | 8 | even | 8 | - | 10 | even | 9 | - | 1 | odd | 2 | - | 3 | odd | 3 | - | 5 | odd | 5 | - | 7 | odd | 7 | - | 9 | odd | 8 | -``` - -### COUNT() - -grammar: - -```sql -COUNT([DISTINCT | ALL] expression) [OVER (analytic_clause)] -``` - -For example: - -Count the number of occurrences of x from the current line to the first line. - -```sql -select x, property, -count(x) over -( -partition by property -order by x -rows between unbounded preceding and current row -) as 'cumulative total' -from int_t where property in ('odd','even'); - | x | property | cumulative count | - |----|----------|------------------| - | 2 | even | 1 | - | 4 | even | 2 | - | 6 | even | 3 | - | 8 | even | 4 | - | 10 | even | 5 | - | 1 | odd | 1 | - | 3 | odd | 2 | - | 5 | odd | 3 | - | 7 | odd | 4 | - | 9 | odd | 5 | -``` - -### DENSE_RANK() - -The DENSE_RANK() function is used to indicate the ranking. Unlike RANK(), DENSE_RANK() does not have vacant numbers. For example, if there are two parallel ones, the third number of DENSE_RANK() is still 2, and the third number of RANK() is 3. - -grammar: - -```sql -DENSE_RANK() OVER(partition_by_clause order_by_clause) -``` - -For example: - -The following example shows the ranking of the x column grouped by the property column: - -```sql - select x, y, dense_rank() over(partition by x order by y) as rank from int_t; - | x | y | rank | - |----|------|----------| - | 1 | 1 | 1 | - | 1 | 2 | 2 | - | 1 | 2 | 2 | - | 2 | 1 | 1 | - | 2 | 2 | 2 | - | 2 | 3 | 3 | - | 3 | 1 | 1 | - | 3 | 1 | 1 | - | 3 | 2 | 2 | -``` - -### FIRST_VALUE() - -FIRST_VALUE() returns the first value in the window range. - -grammar: - -```sql -FIRST_VALUE(expr) OVER(partition_by_clause order_by_clause [window_clause]) -``` - -For example: - -We have the following data - -```sql - select name, country, greeting from mail_merge; - | name | country | greeting | - |---------|---------|--------------| - | Pete | USA | Hello | - | John | USA | Hi | - | Boris | Germany | Guten tag | - | Michael | Germany | Guten morgen | - | Bjorn | Sweden | Hej | - | Mats | Sweden | Tja | -``` - -Use FIRST_VALUE() to group by country and return the value of the first greeting in each group: - -```sql -select country, name, -first_value(greeting) -over (partition by country order by name, greeting) as greeting from mail_merge; -| country | name | greeting | -|---------|---------|-----------| -| Germany | Boris | Guten tag | -| Germany | Michael | Guten tag | -| Sweden | Bjorn | Hej | -| Sweden | Mats | Hej | -| USA | John | Hi | -| USA | Pete | Hi | -``` - -### LAG() - -The LAG() method is used to calculate the value of several lines forward from the current line. - -grammar: - -```sql -LAG (expr, offset, default) OVER (partition_by_clause order_by_clause) -``` - -For example: - -Calculate the closing price of the previous day - -```sql -select stock_symbol, closing_date, closing_price, -lag(closing_price,1, 0) over (partition by stock_symbol order by closing_date) as "yesterday closing" -from stock_ticker -order by closing_date; -| stock_symbol | closing_date | closing_price | yesterday closing | -|--------------|---------------------|---------------|-------------------| -| JDR | 2014-09-13 00:00:00 | 12.86 | 0 | -| JDR | 2014-09-14 00:00:00 | 12.89 | 12.86 | -| JDR | 2014-09-15 00:00:00 | 12.94 | 12.89 | -| JDR | 2014-09-16 00:00:00 | 12.55 | 12.94 | -| JDR | 2014-09-17 00:00:00 | 14.03 | 12.55 | -| JDR | 2014-09-18 00:00:00 | 14.75 | 14.03 | -| JDR | 2014-09-19 00:00:00 | 13.98 | 14.75 | -``` - -### LAST_VALUE() - -LAST_VALUE() returns the last value in the window range. Contrary to FIRST_VALUE(). - -grammar: - -```sql -LAST_VALUE(expr) OVER(partition_by_clause order_by_clause [window_clause]) -``` - -Use the data in the FIRST_VALUE() example: - -```sql -select country, name, -last_value(greeting) -over (partition by country order by name, greeting) as greeting -from mail_merge; -| country | name | greeting | -|---------|---------|--------------| -| Germany | Boris | Guten morgen | -| Germany | Michael | Guten morgen | -| Sweden | Bjorn | Tja | -| Sweden | Mats | Tja | -| USA | John | Hello | -| USA | Pete | Hello | -``` - -### LEAD() - -The LEAD() method is used to calculate the value of several rows from the current row. - -grammar: - -```sql -LEAD (expr, offset, default]) OVER (partition_by_clause order_by_clause) -``` - -For example: - -Calculate the trend of the closing price of the next day compared to the closing price of the day, that is, whether the closing price of the next day is higher or lower than that of the day. - -```sql -select stock_symbol, closing_date, closing_price, -case -(lead(closing_price,1, 0) -over (partition by stock_symbol order by closing_date)-closing_price) > 0 -when true then "higher" -when false then "flat or lower" -end as "trending" -from stock_ticker -order by closing_date; -| stock_symbol | closing_date | closing_price | trending | -|--------------|---------------------|---------------|---------------| -| JDR | 2014-09-13 00:00:00 | 12.86 | higher | -| JDR | 2014-09-14 00:00:00 | 12.89 | higher | -| JDR | 2014-09-15 00:00:00 | 12.94 | flat or lower | -| JDR | 2014-09-16 00:00:00 | 12.55 | higher | -| JDR | 2014-09-17 00:00:00 | 14.03 | higher | -| JDR | 2014-09-18 00:00:00 | 14.75 | flat or lower | -| JDR | 2014-09-19 00:00:00 | 13.98 | flat or lower | -``` - -### MAX() - -grammar: - -```sql -MAX([DISTINCT | ALL] expression) [OVER (analytic_clause)] -``` - -For example: - -Calculate the maximum value from the first line to the line after the current line - -```sql -select x, property, -max(x) over -( -order by property, x -rows between unbounded preceding and 1 following -) as 'local maximum' -from int_t where property in ('prime','square'); -| x | property | local maximum | -|---|----------|---------------| -| 2 | prime | 3 | -| 3 | prime | 5 | -| 5 | prime | 7 | -| 7 | prime | 7 | -| 1 | square | 7 | -| 4 | square | 9 | -| 9 | square | 9 | -``` - -### MIN() - -grammar: - -```sql -MIN([DISTINCT | ALL] expression) [OVER (analytic_clause)] -``` - -For example: - -Calculate the minimum value from the first line to the line after the current line - -```sql -select x, property, -min(x) over -( -order by property, x desc -rows between unbounded preceding and 1 following -) as 'local minimum' -from int_t where property in ('prime','square'); -| x | property | local minimum | -|---|----------|---------------| -| 7 | prime | 5 | -| 5 | prime | 3 | -| 3 | prime | 2 | -| 2 | prime | 2 | -| 9 | square | 2 | -| 4 | square | 1 | -| 1 | square | 1 | -``` - -### RANK() - -The RANK() function is used to indicate ranking. Unlike DENSE_RANK(), RANK() will have vacant numbers. For example, if there are two parallel 1s, the third number in RANK() is 3, not 2. - -grammar: - -```sql -RANK() OVER(partition_by_clause order_by_clause) -``` - -For example: - -Rank according to x - -```sql -select x, y, rank() over(partition by x order by y) as rank from int_t; -| x | y | rank | -|----|------|----------| -| 1 | 1 | 1 | -| 1 | 2 | 2 | -| 1 | 2 | 2 | -| 2 | 1 | 1 | -| 2 | 2 | 2 | -| 2 | 3 | 3 | -| 3 | 1 | 1 | -| 3 | 1 | 1 | -| 3 | 2 | 3 | -``` - -### ROW_NUMBER() - -For each row of each Partition, an integer that starts from 1 and increases continuously is returned. Unlike RANK() and DENSE_RANK(), the value returned by ROW_NUMBER() will not be repeated or vacant, and is continuously increasing. - -grammar: - -```sql -ROW_NUMBER() OVER(partition_by_clause order_by_clause) -``` - -For example: - -```sql -select x, y, row_number() over(partition by x order by y) as rank from int_t; -| x | y | rank | -|---|------|----------| -| 1 | 1 | 1 | -| 1 | 2 | 2 | -| 1 | 2 | 3 | -| 2 | 1 | 1 | -| 2 | 2 | 2 | -| 2 | 3 | 3 | -| 3 | 1 | 1 | -| 3 | 1 | 2 | -| 3 | 2 | 3 | -``` - -### SUM() - -grammar: - -```sql -SUM([DISTINCT | ALL] expression) [OVER (analytic_clause)] -``` - -For example: - -Group according to property, and calculate the sum of the x column of the current row and each row before and after in the group. - -```sql -select x, property, -sum(x) over -( -partition by property -order by x -rows between 1 preceding and 1 following -) as 'moving total' -from int_t where property in ('odd','even'); -| x | property | moving total | -|----|----------|--------------| -| 2 | even | 6 | -| 4 | even | 12 | -| 6 | even | 18 | -| 8 | even | 24 | -| 10 | even | 18 | -| 1 | odd | 4 | -| 3 | odd | 9 | -| 5 | odd | 15 | -| 7 | odd | 21 | -| 9 | odd | 16 | -``` - diff --git a/docs/en/sql-manual/sql-reference/Data-Definition-Statements/Backup-and-Restore/RECOVER.md b/docs/en/sql-manual/sql-reference/Data-Definition-Statements/Backup-and-Restore/RECOVER.md deleted file mode 100644 index 02c85fec4abbf8..00000000000000 --- a/docs/en/sql-manual/sql-reference/Data-Definition-Statements/Backup-and-Restore/RECOVER.md +++ /dev/null @@ -1,87 +0,0 @@ ---- -{ - "title": "RECOVER", - "language": "en" -} ---- - - - -## RECOVER - -### Name - -REVOCER - -### Description - -This statement is used to restore a previously deleted database, table or partition - -grammar: - -1. restore database - - ```sql - RECOVER DATABASE db_name; - ``` - -2. restore table - - ```sql - RECOVER TABLE [db_name.]table_name; - ``` - - 3. restore partition - - ```sql - RECOVER PARTITION partition_name FROM [db_name.]table_name; - ``` - -illustrate: - -- This operation can only restore meta information that was deleted in the previous period. Default is 1 day. (Configurable through the `catalog_trash_expire_second` parameter in fe.conf) -- If a new meta information with the same name and type is created after the meta information is deleted, the previously deleted meta information cannot be recovered - -### Example - -1. Restore the database named example_db - -```sql -RECOVER DATABASE example_db; -``` - -2. Restore the table named example_tbl - -```sql -RECOVER TABLE example_db.example_tbl; -``` - -3. Restore the partition named p1 in table example_tbl - -```sql -RECOVER PARTITION p1 FROM example_tbl; -``` - -### Keywords - - RECOVER - -### Best Practice - diff --git a/docs/en/sql-manual/sql-reference/Data-Manipulation-Statements/Load/MULTI-LOAD.md b/docs/en/sql-manual/sql-reference/Data-Manipulation-Statements/Load/MULTI-LOAD.md index 57c9017258aac2..baf5c64964b23f 100644 --- a/docs/en/sql-manual/sql-reference/Data-Manipulation-Statements/Load/MULTI-LOAD.md +++ b/docs/en/sql-manual/sql-reference/Data-Manipulation-Statements/Load/MULTI-LOAD.md @@ -24,6 +24,8 @@ specific language governing permissions and limitations under the License. --> +## MULTI-LOAD + ### Name MULTI LOAD @@ -112,7 +114,7 @@ Import the data of 'testData2' into table 'testTbl2' in 'testDb' (user is in def curl --location-trusted -u root -XPOST http://host:port/api/testDb/_multi_desc?label=123 ```` -### Keyword +### Keywords ``` MULTI, MINI, LOAD diff --git a/docs/en/sql-manual/sql-reference/Data-Manipulation-Statements/OUTFILE.md b/docs/en/sql-manual/sql-reference/Data-Manipulation-Statements/OUTFILE.md index fd0978629b317d..244c0173abb690 100644 --- a/docs/en/sql-manual/sql-reference/Data-Manipulation-Statements/OUTFILE.md +++ b/docs/en/sql-manual/sql-reference/Data-Manipulation-Statements/OUTFILE.md @@ -24,12 +24,12 @@ specific language governing permissions and limitations under the License. --> -# OUTFILE +## OUTFILE ### Name OURFILE -##description +### description This statement is used to export query results to a file using the `SELECT INTO OUTFILE` command. Currently, it supports exporting to remote storage, such as HDFS, S3, BOS, COS (Tencent Cloud), through the Broker process, through the S3 protocol, or directly through the HDFS protocol. @@ -87,7 +87,7 @@ illustrate: AWS_SECRET_KEY AWS_REGION -## example +### example 1. Use the broker method to export, and export the simple query results to the file `hdfs://path/to/result.txt`. Specifies that the export format is CSV. Use `my_broker` and set kerberos authentication information. Specify the column separator as `,` and the row separator as `\n`. @@ -249,11 +249,9 @@ illustrate: If the final generated file is not larger than 100MB, it will be: `result_0.csv`. If larger than 100MB, it may be `result_0.csv, result_1.csv, ...`. -## keyword +### keywords -``` OUTFILE -``` ### Best Practice diff --git a/docs/en/sql-manual/sql-reference/Data-Types/BIGINT.md b/docs/en/sql-manual/sql-reference/Data-Types/BIGINT.md index b0122e47b96b73..5ceab3c35d3ec0 100644 --- a/docs/en/sql-manual/sql-reference/Data-Types/BIGINT.md +++ b/docs/en/sql-manual/sql-reference/Data-Types/BIGINT.md @@ -24,10 +24,10 @@ specific language governing permissions and limitations under the License. --> -# BIGINT -## Description +## BIGINT +### Description BIGINT 8-byte signed integer, range [-9223372036854775808, 9223372036854775807] -## keyword +### keywords BIGINT diff --git a/docs/en/sql-manual/sql-reference/Data-Types/BITMAP.md b/docs/en/sql-manual/sql-reference/Data-Types/BITMAP.md index 29d8a75331e74b..24ae635e6b0cd8 100644 --- a/docs/en/sql-manual/sql-reference/Data-Types/BITMAP.md +++ b/docs/en/sql-manual/sql-reference/Data-Types/BITMAP.md @@ -24,8 +24,8 @@ specific language governing permissions and limitations under the License. --> -#BITMAP -## Description +## BITMAP +### Description BITMAP BITMAP cannot be used as a key column, and the aggregation type is BITMAP_UNION when building the table. @@ -35,7 +35,7 @@ And the BITMAP column can only be queried or used by supporting functions such a The use of BITMAP in offline scenarios will affect the import speed. In the case of a large amount of data, the query speed will be slower than HLL and better than Count Distinct. Note: If BITMAP does not use a global dictionary in real-time scenarios, using bitmap_hash() may cause an error of about one-thousandth. -## example +### example select hour, BITMAP_UNION_COUNT(pv) over(order by hour) uv from( select hour, BITMAP_UNION(device_id) as pv @@ -44,5 +44,5 @@ Note: If BITMAP does not use a global dictionary in real-time scenarios, using b group by hour order by 1 ) final; -## keyword +### keywords BITMAP diff --git a/docs/en/sql-manual/sql-reference/Data-Types/BOOLEAN.md b/docs/en/sql-manual/sql-reference/Data-Types/BOOLEAN.md index ad4a7b682e0d00..d678a548e2cc94 100644 --- a/docs/en/sql-manual/sql-reference/Data-Types/BOOLEAN.md +++ b/docs/en/sql-manual/sql-reference/Data-Types/BOOLEAN.md @@ -24,10 +24,10 @@ specific language governing permissions and limitations under the License. --> -# BOOLEAN -## Description +## BOOLEAN +### Description BOOL, BOOLEAN Like TINYINT, 0 stands for false and 1 for true. -## keyword +### keywords BOOLEAN diff --git a/docs/en/sql-manual/sql-reference/Data-Types/CHAR.md b/docs/en/sql-manual/sql-reference/Data-Types/CHAR.md index 04c41c88fd5879..ffbca3621c08ba 100644 --- a/docs/en/sql-manual/sql-reference/Data-Types/CHAR.md +++ b/docs/en/sql-manual/sql-reference/Data-Types/CHAR.md @@ -24,10 +24,10 @@ specific language governing permissions and limitations under the License. --> -# CHAR -## Description +## CHAR +### Description CHAR(M) A fixed-length string, M represents the length of a fixed-length string. The range of M is 1-255. -## keyword +### keywords CHAR diff --git a/docs/en/sql-manual/sql-reference/Data-Types/DATE.md b/docs/en/sql-manual/sql-reference/Data-Types/DATE.md index 05610fb8205f9d..54e89827fdd24f 100644 --- a/docs/en/sql-manual/sql-reference/Data-Types/DATE.md +++ b/docs/en/sql-manual/sql-reference/Data-Types/DATE.md @@ -24,8 +24,8 @@ specific language governing permissions and limitations under the License. --> -# date -## Description +## date +### Description DATE function Syntax: Date @@ -33,9 +33,9 @@ Convert input type to DATE type date Date type, the current range of values is ['0000-01-01','9999-12-31'], and the default print form is 'YYYYY-MM-DD'. -## example +### example mysql> SELECT DATE('2003-12-31 01:02:03'); -> '2003-12-31' -## keyword +### keywords DATE diff --git a/docs/en/sql-manual/sql-reference/Data-Types/DATETIME.md b/docs/en/sql-manual/sql-reference/Data-Types/DATETIME.md index 152f1da5a5720c..76f7e8374de70b 100644 --- a/docs/en/sql-manual/sql-reference/Data-Types/DATETIME.md +++ b/docs/en/sql-manual/sql-reference/Data-Types/DATETIME.md @@ -24,11 +24,11 @@ specific language governing permissions and limitations under the License. --> -# DATETIME -## Description +## DATETIME +### Description DATETIME Date and time type, value range is ['0000-01-01 00:00:00','9999-12-31 23:59:59']. The form of printing is 'YYYY-MM-DD HH:MM:SS' -## keyword +### keywords DATETIME diff --git a/docs/en/sql-manual/sql-reference/Data-Types/DECIMAL.md b/docs/en/sql-manual/sql-reference/Data-Types/DECIMAL.md index 292f5fb7174c42..95b78bedff60f1 100644 --- a/docs/en/sql-manual/sql-reference/Data-Types/DECIMAL.md +++ b/docs/en/sql-manual/sql-reference/Data-Types/DECIMAL.md @@ -24,11 +24,11 @@ specific language governing permissions and limitations under the License. --> -# DECIMAL -## Description +## DECIMAL +### Description DECIMAL (M [,D]) High-precision fixed-point, M stands for the total number of significant numbers (precision), D stands for the maximum number of decimal points (scale) The range of M is [1,27], the range of D is [1,9], in addition, M must be greater than or equal to the value of D. The default value of D is 0. -## keyword +### keywords DECIMAL diff --git a/docs/en/sql-manual/sql-reference/Data-Types/DOUBLE.md b/docs/en/sql-manual/sql-reference/Data-Types/DOUBLE.md index 96a8b31c862a09..ce5c4822ecf9ab 100644 --- a/docs/en/sql-manual/sql-reference/Data-Types/DOUBLE.md +++ b/docs/en/sql-manual/sql-reference/Data-Types/DOUBLE.md @@ -24,10 +24,10 @@ specific language governing permissions and limitations under the License. --> -# Double -## Description +## Double +### Description DOUBLE 8-byte floating point number -## keyword +### keywords DOUBLE \ No newline at end of file diff --git a/docs/en/sql-manual/sql-reference/Data-Types/FLOAT.md b/docs/en/sql-manual/sql-reference/Data-Types/FLOAT.md index aab56149325f0a..3fe700a325165c 100644 --- a/docs/en/sql-manual/sql-reference/Data-Types/FLOAT.md +++ b/docs/en/sql-manual/sql-reference/Data-Types/FLOAT.md @@ -24,10 +24,10 @@ specific language governing permissions and limitations under the License. --> -# FLOAT -## Description +## FLOAT +### Description FLOAT 4-byte floating point number -## keyword +### keywords FLOAT diff --git a/docs/en/sql-manual/sql-reference/Data-Types/HLL.md b/docs/en/sql-manual/sql-reference/Data-Types/HLL.md index 999a897a88f88a..65e452f546473e 100644 --- a/docs/en/sql-manual/sql-reference/Data-Types/HLL.md +++ b/docs/en/sql-manual/sql-reference/Data-Types/HLL.md @@ -24,8 +24,8 @@ specific language governing permissions and limitations under the License. --> -#HLL (HyperLogLog) -## Description +## HLL (HyperLogLog) +### Description HLL HLL cannot be used as a key column, and the aggregation type is HLL_UNION when create table. @@ -36,7 +36,7 @@ And HLL columns can only be queried or used through the matching hll_union_agg, HLL is approximate count of distinct elements, and its performance is better than Count Distinct when the amount of data is large. The error of HLL is usually around 1%, sometimes up to 2%. -## example +### example select hour, HLL_UNION_AGG(pv) over(order by hour) uv from( select hour, HLL_RAW_AGG(device_id) as pv @@ -45,5 +45,5 @@ The error of HLL is usually around 1%, sometimes up to 2%. group by hour order by 1 ) final; -## keyword +### keywords HLL,HYPERLOGLOG diff --git a/docs/en/sql-manual/sql-reference/Data-Types/INT.md b/docs/en/sql-manual/sql-reference/Data-Types/INT.md index 10cb4e880a31a5..ba304b8c3b40c7 100644 --- a/docs/en/sql-manual/sql-reference/Data-Types/INT.md +++ b/docs/en/sql-manual/sql-reference/Data-Types/INT.md @@ -24,10 +24,10 @@ specific language governing permissions and limitations under the License. --> -# INT -## Description +## INT +### Description INT 4-byte signed integer, range [-2147483648, 2147483647] -## keyword +### keywords INT diff --git a/docs/en/sql-manual/sql-reference/Data-Types/QUANTILE_STATE.md b/docs/en/sql-manual/sql-reference/Data-Types/QUANTILE_STATE.md index 83c07ec017ba9b..df1edccc7c84e6 100644 --- a/docs/en/sql-manual/sql-reference/Data-Types/QUANTILE_STATE.md +++ b/docs/en/sql-manual/sql-reference/Data-Types/QUANTILE_STATE.md @@ -24,8 +24,8 @@ specific language governing permissions and limitations under the License. --> -# QUANTILE_STATE -## description +## QUANTILE_STATE +### description QUANTILE_STATE @@ -53,10 +53,10 @@ related functions: -## example +### example select QUANTILE_PERCENT(QUANTILE_UNION(v1)) from test_table group by k1, k2, k3; -## keyword +### keywords QUANTILE_STATE, QUANTILE_UNION, TO_QUANTILE_STATE, QUANTILE_PERCENT diff --git a/docs/en/sql-manual/sql-reference/Data-Types/SMALLINT.md b/docs/en/sql-manual/sql-reference/Data-Types/SMALLINT.md index 66ffadc0a61b98..602cbd3e774d1a 100644 --- a/docs/en/sql-manual/sql-reference/Data-Types/SMALLINT.md +++ b/docs/en/sql-manual/sql-reference/Data-Types/SMALLINT.md @@ -24,10 +24,10 @@ specific language governing permissions and limitations under the License. --> -# SMALLINT -## Description +## SMALLINT +### Description SMALLINT 2-byte signed integer, range [-32768, 32767] -## keyword +### keywords SMALLINT diff --git a/docs/en/sql-manual/sql-reference/Data-Types/STRING.md b/docs/en/sql-manual/sql-reference/Data-Types/STRING.md index 9a019395bdc79d..c25895c98a106f 100644 --- a/docs/en/sql-manual/sql-reference/Data-Types/STRING.md +++ b/docs/en/sql-manual/sql-reference/Data-Types/STRING.md @@ -24,12 +24,12 @@ specific language governing permissions and limitations under the License. --> -# STRING -## Description +## STRING +### Description STRING (M) A variable length string, max legnth is 2147483643(2GB - 4). The length of the String type is also limited by the configuration `string_type_length_soft_limit_bytes` of be, the actual maximum length that can be stored take the minimum value of both, the String type can only be used in the value column, not in the key column and the partition and bucket columns Note: Variable length strings are stored in UTF-8 encoding, so usually English characters occupies 1 byte, and Chinese characters occupies 3 bytes. -## keyword +### keywords STRING diff --git a/docs/en/sql-manual/sql-reference/Data-Types/TINYINT.md b/docs/en/sql-manual/sql-reference/Data-Types/TINYINT.md index b7b6bd747aafb1..dfc16e12089a15 100644 --- a/docs/en/sql-manual/sql-reference/Data-Types/TINYINT.md +++ b/docs/en/sql-manual/sql-reference/Data-Types/TINYINT.md @@ -24,10 +24,10 @@ specific language governing permissions and limitations under the License. --> -# TINYINT -## Description +## TINYINT +### Description TINYINT 1 byte signed integer, range [-128, 127] -## keyword +### keywords TINYINT diff --git a/docs/en/sql-manual/sql-reference/Data-Types/VARCHAR.md b/docs/en/sql-manual/sql-reference/Data-Types/VARCHAR.md index 4a5dbd6c6aee84..85c073022769de 100644 --- a/docs/en/sql-manual/sql-reference/Data-Types/VARCHAR.md +++ b/docs/en/sql-manual/sql-reference/Data-Types/VARCHAR.md @@ -24,12 +24,12 @@ specific language governing permissions and limitations under the License. --> -# VARCHAR -## Description +## VARCHAR +### Description VARCHAR(M) A variable length string, M represents the byte length of a variable length string. The range of M is 1-65533. Note: Variable length strings are stored in UTF-8 encoding, so usually English characters occupies 1 byte, and Chinese characters occupies 3 bytes. -## keyword +### keywords VARCHAR diff --git a/docs/en/sql-manual/sql-reference/Database-Administration-Statements/ADMIN-SHOW-TABLET-STORAGE-FORMAT.md b/docs/en/sql-manual/sql-reference/Database-Administration-Statements/ADMIN-SHOW-TABLET-STORAGE-FORMAT.md index 06692f08788365..762ad53e1f1955 100644 --- a/docs/en/sql-manual/sql-reference/Database-Administration-Statements/ADMIN-SHOW-TABLET-STORAGE-FORMAT.md +++ b/docs/en/sql-manual/sql-reference/Database-Administration-Statements/ADMIN-SHOW-TABLET-STORAGE-FORMAT.md @@ -24,13 +24,13 @@ specific language governing permissions and limitations under the License. --> -# ADMIN SHOW TABLET STORAGE FORMAT -## description +## ADMIN SHOW TABLET STORAGE FORMAT +### description This statement is used to display tablet storage foramt information (for administrators only) Grammar: ADMIN SHOW TABLET STORAGE FORMAT [VERBOSE] -## example +### example MySQL [(none)]> admin show tablet storage format; +-----------+---------+---------+ | BackendId | V1Count | V2Count | @@ -48,6 +48,7 @@ under the License. | 10002 | 39199 | V2 | +-----------+----------+---------------+ 4 rows in set (0.034 sec) -## keyword + +### keywords ADMIN,SHOW,TABLET,STORAGE,FORMAT diff --git a/docs/en/sql-manual/sql-reference/Database-Administration-Statements/RECOVER.md b/docs/en/sql-manual/sql-reference/Database-Administration-Statements/RECOVER.md index c7b3e7d85e8642..ef9193ad169627 100644 --- a/docs/en/sql-manual/sql-reference/Database-Administration-Statements/RECOVER.md +++ b/docs/en/sql-manual/sql-reference/Database-Administration-Statements/RECOVER.md @@ -32,59 +32,56 @@ RECOVER ### Description -This statement is used to restore a previously deleted database, table or partition. +This statement is used to restore a previously deleted database, table or partition grammar: -1. Restore the database - +1. restore database - ```sql - RECOVER DATABASE db_name; - ```` + ```sql + RECOVER DATABASE db_name; + ``` -1. Restore the table - +2. restore table - ```sql - RECOVER TABLE [db_name.]table_name; - ```` + ```sql + RECOVER TABLE [db_name.]table_name; + ``` -1. restore partition - + 3. restore partition - ```sql - RECOVER PARTITION partition_name FROM [db_name.]table_name; - ```` + ```sql + RECOVER PARTITION partition_name FROM [db_name.]table_name; + ``` illustrate: -1. This operation can only restore meta information that was deleted within a certain period of time. Default is 1 day. (Configurable through the `catalog_trash_expire_second` parameter in fe.conf) -2. If a new meta information with the same name and type is created after the meta information is deleted, the previously deleted meta information cannot be recovered. +- This operation can only restore meta information that was deleted in the previous period. Default is 1 day. (Configurable through the `catalog_trash_expire_second` parameter in fe.conf) +- If a new meta information with the same name and type is created after the meta information is deleted, the previously deleted meta information cannot be recovered ### Example -1. Restore the database named example_db; +1. Restore the database named example_db - ```sql - RECOVER DATABASE example_db; - ```` +```sql +RECOVER DATABASE example_db; +``` 2. Restore the table named example_tbl - ```sql - RECOVER TABLE example_db.example_tbl; - ```` +```sql +RECOVER TABLE example_db.example_tbl; +``` 3. Restore the partition named p1 in table example_tbl - ```sql - RECOVER PARTITION p1 FROM example_tbl; - ```` +```sql +RECOVER PARTITION p1 FROM example_tbl; +``` ### Keywords - RECOVER + RECOVER ### Best Practice diff --git a/docs/en/sql-manual/sql-reference/Show-Statements/SHOW-LAST-INSERT.md b/docs/en/sql-manual/sql-reference/Show-Statements/SHOW-LAST-INSERT.md index e226619d79ec66..3c820435bf7890 100644 --- a/docs/en/sql-manual/sql-reference/Show-Statements/SHOW-LAST-INSERT.md +++ b/docs/en/sql-manual/sql-reference/Show-Statements/SHOW-LAST-INSERT.md @@ -70,6 +70,8 @@ illustrate: ### Example +### Keywords + SHOW, LASR ,INSERT ### Best Practice diff --git a/docs/zh-CN/get-starting/get-starting.md b/docs/zh-CN/get-starting/get-starting.md index 36a9503b191e2b..fa243f0a6a19eb 100644 --- a/docs/zh-CN/get-starting/get-starting.md +++ b/docs/zh-CN/get-starting/get-starting.md @@ -151,7 +151,7 @@ Doris 采用 MySQL 协议进行通信,用户可通过 MySQL Client 或者 MySQ 默认使用 Http 协议进行 WebUI 访问,在浏览器输入以下格式地址访问 -```cql +``` http://FE_IP:FE_HTTP_PORT(默认8030) ``` @@ -689,4 +689,4 @@ FE 将查询计划拆分成为 Fragment 下发到 BE 进行任务执行。BE 在 DELETE FROM my_table PARTITIONS (p1, p2) WHERE k1 >= 3 AND k2 = "abc"; ``` - \ No newline at end of file + diff --git a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/approx_count_distinct.md b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/approx_count_distinct.md index 71e9d2b22ee5c9..bc23f856d98ae5 100644 --- a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/approx_count_distinct.md +++ b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/approx_count_distinct.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# APPROX_COUNT_DISTINCT -## description -### Syntax +## APPROX_COUNT_DISTINCT +### description +#### Syntax `APPROX_COUNT_DISTINCT(expr)` @@ -35,7 +35,7 @@ under the License. 它比 COUNT 和 DISTINCT 组合的速度更快,并使用固定大小的内存,因此对于高基数的列可以使用更少的内存。 -## example +### example ``` MySQL > select approx_count_distinct(query_id) from log_statis group by datetime; +-----------------+ @@ -44,5 +44,5 @@ MySQL > select approx_count_distinct(query_id) from log_statis group by datetime | 17721 | +-----------------+ ``` -## keyword +### keywords APPROX_COUNT_DISTINCT diff --git a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/avg.md b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/avg.md index 142c1dcdabb484..3cff5f47ccf4ee 100644 --- a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/avg.md +++ b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/avg.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# AVG -## description -### Syntax +## AVG +### description +#### Syntax `AVG([DISTINCT] expr)` @@ -35,7 +35,7 @@ under the License. 可选字段DISTINCT参数可以用来返回去重平均值 -## example +### example ``` mysql> SELECT datetime, AVG(cost_time) FROM log_statis group by datetime; @@ -53,5 +53,5 @@ mysql> SELECT datetime, AVG(distinct cost_time) FROM log_statis group by datetim +---------------------+---------------------------+ ``` -## keyword +### keywords AVG diff --git a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/bitmap_union.md b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/bitmap_union.md index fd2e72ed3b9cd3..f4742b8d6091cb 100644 --- a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/bitmap_union.md +++ b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/bitmap_union.md @@ -24,9 +24,13 @@ specific language governing permissions and limitations under the License. --> -# BITMAP_UNION +## BITMAP_UNION -## Create table +### description + +### example + +#### Create table 建表时需要使用聚合模型,数据类型是 bitmap , 聚合函数是 bitmap_union @@ -46,7 +50,7 @@ DISTRIBUTED BY HASH(`dt`) BUCKETS 2; ALTER TABLE pv_bitmap ADD ROLLUP pv (page, user_id); ``` -## Data Load +#### Data Load `TO_BITMAP(expr)` : 将 0 ~ 18446744073709551615 的 unsigned bigint 转为 bitmap @@ -54,7 +58,7 @@ ALTER TABLE pv_bitmap ADD ROLLUP pv (page, user_id); `BITMAP_HASH(expr)`: 将任意类型的列通过 Hash 的方式转为 bitmap -### Stream Load +##### Stream Load ``` cat data | curl --location-trusted -u user:passwd -T - -H "columns: dt,page,user_id, user_id=to_bitmap(user_id)" http://host:8410/api/test/testDb/_stream_load @@ -68,7 +72,7 @@ cat data | curl --location-trusted -u user:passwd -T - -H "columns: dt,page,user cat data | curl --location-trusted -u user:passwd -T - -H "columns: dt,page,user_id, user_id=bitmap_empty()" http://host:8410/api/test/testDb/_stream_load ``` -### Insert Into +##### Insert Into id2 的列类型是 bitmap ``` @@ -95,9 +99,8 @@ id2 的列类型是 String insert into bitmap_table1 select id, bitmap_hash(id_string) from table; ``` - -## Data Query -### Syntax +#### Data Query +##### Syntax `BITMAP_UNION(expr)` : 计算输入 Bitmap 的并集,返回新的bitmap @@ -112,7 +115,7 @@ filter_column 过滤条件的多个 bitmap 的交集的基数值。 bitmap_column_to_count 是 bitmap 类型的列,filter_column 是变化的维度列,filter_values 是维度取值列表 -### Example +##### Example 下面的 SQL 以上面的 pv_bitmap table 为例: @@ -140,7 +143,6 @@ from pv_bitmap where page in ('meituan', 'waimai'); ``` - -## keyword +### keywords BITMAP,BITMAP_COUNT,BITMAP_EMPTY,BITMAP_UNION,BITMAP_UNION_INT,TO_BITMAP,BITMAP_UNION_COUNT,INTERSECT_COUNT diff --git a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/count.md b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/count.md index 817d7e03f0bade..73f962a6ae05cd 100755 --- a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/count.md +++ b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/count.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# COUNT -## description -### Syntax +## COUNT +### description +#### Syntax `COUNT([DISTINCT] expr)` 用于返回满足要求的行的数目 -## example +### example ``` MySQL > select count(*) from log_statis group by datetime; @@ -57,5 +57,5 @@ MySQL > select count(distinct datetime) from log_statis group by datetime; | 71045 | +-------------------------------+ ``` -## keyword +### keywords COUNT diff --git a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/group_concat.md b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/group_concat.md index 8e2a3f4169ea8a..3a92c31f233fe8 100644 --- a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/group_concat.md +++ b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/group_concat.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# group_concat -## description -### Syntax +## group_concat +### description +#### Syntax `VARCHAR GROUP_CONCAT(VARCHAR str[, VARCHAR sep])` 该函数是类似于 sum() 的聚合函数,group_concat 将结果集中的多行结果连接成一个字符串。第二个参数 sep 为字符串之间的连接符号,该参数可以省略。该函数通常需要和 group by 语句一起使用。 -## example +### example ``` mysql> select value from test; @@ -66,5 +66,5 @@ mysql> select GROUP_CONCAT(value, NULL) from test; | NULL | +----------------------------+ ``` -## keyword +### keywords GROUP_CONCAT,GROUP,CONCAT diff --git a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/hll_union_agg.md b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/hll_union_agg.md index 7e3b0e1a04c00d..58922fa18404b2 100644 --- a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/hll_union_agg.md +++ b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/hll_union_agg.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# HLL_UNION_AGG -## description -### Syntax +## HLL_UNION_AGG +### description +#### Syntax `HLL_UNION_AGG(hll)` @@ -39,7 +39,7 @@ HLL是基于HyperLogLog算法的工程实现,用于保存HyperLogLog计算过 导入的时候通过hll_hash函数来指定数据中哪一列用于生成hll列,它常用于替代count distinct,通过结合rollup在业务上用于快速计算uv等 -## example +### example ``` MySQL > select HLL_UNION_AGG(uv_set) from test_uv;; +-------------------------+ @@ -48,5 +48,5 @@ MySQL > select HLL_UNION_AGG(uv_set) from test_uv;; | 17721 | +-------------------------+ ``` -## keyword +### keywords HLL_UNION_AGG,HLL,UNION,AGG diff --git a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/max.md b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/max.md index 22522c65a14699..73d0a18a862483 100755 --- a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/max.md +++ b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/max.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# MAX -## description -### Syntax +## MAX +### description +#### Syntax `MAX(expr)` 返回expr表达式的最大值 -## example +### example ``` MySQL > select max(scan_rows) from log_statis group by datetime; +------------------+ @@ -42,5 +42,5 @@ MySQL > select max(scan_rows) from log_statis group by datetime; | 4671587 | +------------------+ ``` -## keyword +### keywords MAX diff --git a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/max_by.md b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/max_by.md index ce9d71da389a6d..aa42f2e041dc9d 100644 --- a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/max_by.md +++ b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/max_by.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# MAX_BY -## description -### Syntax +## MAX_BY +### description +#### Syntax `MAX_BY(expr1, expr2)` 返回与 expr2 的最大值关联的 expr1 的值。 -## example +### example ``` MySQL > select * from tbl; +------+------+------+------+ @@ -52,5 +52,5 @@ MySQL > select max_by(k1, k4) from tbl; | 0 | +--------------------+ ``` -## keyword +### keywords MAX_BY diff --git a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/min.md b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/min.md index 93406089fb8d73..2439d10ac63828 100755 --- a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/min.md +++ b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/min.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# MIN -## description -### Syntax +## MIN +### description +#### Syntax `MIN(expr)` 返回expr表达式的最小值 -## example +### example ``` MySQL > select min(scan_rows) from log_statis group by datetime; +------------------+ @@ -42,5 +42,5 @@ MySQL > select min(scan_rows) from log_statis group by datetime; | 0 | +------------------+ ``` -## keyword +### keywords MIN diff --git a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/min_by.md b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/min_by.md index 59a20cf7f9ed90..6d707d66f452ca 100644 --- a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/min_by.md +++ b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/min_by.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# MIN_BY -## description -### Syntax +## MIN_BY +### description +#### Syntax `MIN_BY(expr1, expr2)` 返回与 expr2 的最小值关联的 expr1 的值。 -## example +### example ``` MySQL > select * from tbl; +------+------+------+------+ @@ -52,5 +52,5 @@ MySQL > select min_by(k1, k4) from tbl; | 4 | +--------------------+ ``` -## keyword +### keywords MIN_BY diff --git a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/percentile.md b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/percentile.md index dfbe24f30de366..7c49e4d3ded6ff 100755 --- a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/percentile.md +++ b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/percentile.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# PERCENTILE -## description -### Syntax +## PERCENTILE +### description +#### Syntax `PERCENTILE(expr, DOUBLE p)` @@ -36,7 +36,7 @@ under the License. expr:必填。值为整数(最大为bigint) 类型的列。 p:必填。需要精确的百分位数。取值为 [0.0,1.0]。 -## example +### example ``` MySQL > select `table`, percentile(cost_time,0.99) from log_statis group by `table`; +---------------------+---------------------------+ @@ -53,5 +53,5 @@ MySQL > select percentile(NULL,0.3) from table1; +-----------------------+ ``` -## keyword +### keywords PERCENTILE diff --git a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/percentile_approx.md b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/percentile_approx.md index 19c68be84ffa86..ae3f230801cb6e 100755 --- a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/percentile_approx.md +++ b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/percentile_approx.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# PERCENTILE_APPROX -## description -### Syntax +## PERCENTILE_APPROX +### description +#### Syntax `PERCENTILE_APPROX(expr, DOUBLE p[, DOUBLE compression])` @@ -38,7 +38,7 @@ compression参数未指定或设置的值在[2048, 10000]范围外,以10000的 该函数使用固定大小的内存,因此对于高基数的列可以使用更少的内存,可用于计算tp99等统计值 -## example +### example ``` MySQL > select `table`, percentile_approx(cost_time,0.99) from log_statis group by `table`; +---------------------+---------------------------+ @@ -55,5 +55,5 @@ MySQL > select `table`, percentile_approx(cost_time,0.99, 4096) from log_statis +----------+--------------------------------------+ ``` -## keyword +### keywords PERCENTILE_APPROX,PERCENTILE,APPROX diff --git a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/stddev.md b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/stddev.md index 2a06d4e7418d89..2e220c8eaf5300 100755 --- a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/stddev.md +++ b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/stddev.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# STDDEV,STDDEV_POP -## description -### Syntax +## STDDEV,STDDEV_POP +### description +#### Syntax `STDDEV(expr)` 返回expr表达式的标准差 -## example +### example ``` MySQL > select stddev(scan_rows) from log_statis group by datetime; +---------------------+ @@ -49,5 +49,5 @@ MySQL > select stddev_pop(scan_rows) from log_statis group by datetime; | 2.3722760595994914 | +-------------------------+ ``` -## keyword +### keywords STDDEV,STDDEV_POP,POP diff --git a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/stddev_samp.md b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/stddev_samp.md index 3c7b505ed29c31..7172c73d8356d1 100755 --- a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/stddev_samp.md +++ b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/stddev_samp.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# STDDEV_SAMP -## description -### Syntax +## STDDEV_SAMP +### description +#### Syntax `STDDEV_SAMP(expr)` 返回expr表达式的样本标准差 -## example +### example ``` MySQL > select stddev_samp(scan_rows) from log_statis group by datetime; +--------------------------+ @@ -42,5 +42,5 @@ MySQL > select stddev_samp(scan_rows) from log_statis group by datetime; | 2.372044195280762 | +--------------------------+ ``` -## keyword +### keywords STDDEV_SAMP,STDDEV,SAMP diff --git a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/sum.md b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/sum.md index abec502baaaea4..35671a8581c17d 100755 --- a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/sum.md +++ b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/sum.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# SUM -## description -### Syntax +## SUM +### description +#### Syntax `SUM(expr)` 用于返回选中字段所有值的和 -## example +### example ``` MySQL > select sum(scan_rows) from log_statis group by datetime; +------------------+ @@ -42,5 +42,5 @@ MySQL > select sum(scan_rows) from log_statis group by datetime; | 8217360135 | +------------------+ ``` -## keyword +### keywords SUM diff --git a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/topn.md b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/topn.md index 11c45440765fdb..feb0774960bd18 100644 --- a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/topn.md +++ b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/topn.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# TOPN -## description -### Syntax +## TOPN +### description +#### Syntax `topn(expr, INT top_num[, INT space_expand_rate])` @@ -38,7 +38,7 @@ counter numbers = top_num * space_expand_rate ``` space_expand_rate的值越大,结果越准确,默认值为50 -## example +### example ``` MySQL [test]> select topn(keyword,10) from keyword_table where date>= '2020-06-01' and date <= '2020-06-19' ; +------------------------------------------------------------------------------------------------------------+ @@ -56,5 +56,5 @@ MySQL [test]> select date,topn(keyword,10,100) from keyword_table where date>= ' | 2020-06-17 | a:9, b:8, c:8, j:8, d:7, e:7, f:7, h:7, i:7, k:7 | +------------+-----------------------------------------------------------------------------------------------+ ``` -## keyword -TOPN \ No newline at end of file +### keywords +TOPN diff --git a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/var_samp.md b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/var_samp.md index 90010e9c586d8c..861d85ef82ec31 100755 --- a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/var_samp.md +++ b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/var_samp.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# VAR_SAMP,VARIANCE_SAMP -## description -### Syntax +## VAR_SAMP,VARIANCE_SAMP +### description +#### Syntax `VAR_SAMP(expr)` 返回expr表达式的样本方差 -## example +### example ``` MySQL > select var_samp(scan_rows) from log_statis group by datetime; +-----------------------+ @@ -43,5 +43,5 @@ MySQL > select var_samp(scan_rows) from log_statis group by datetime; +-----------------------+ ``` -## keyword +### keywords VAR_SAMP,VARIANCE_SAMP,VAR,SAMP,VARIANCE diff --git a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/variance.md b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/variance.md index 2006a3c50f7cfc..585adebc620306 100755 --- a/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/variance.md +++ b/docs/zh-CN/sql-manual/sql-functions/aggregate-functions/variance.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# VARIANCE,VAR_POP,VARIANCE_POP -## description -### Syntax +## VARIANCE,VAR_POP,VARIANCE_POP +### description +#### Syntax `VARIANCE(expr)` 返回expr表达式的方差 -## example +### example ``` MySQL > select variance(scan_rows) from log_statis group by datetime; +-----------------------+ @@ -50,5 +50,5 @@ MySQL > select var_pop(scan_rows) from log_statis group by datetime; +----------------------+ ``` -## keyword +### keywords VARIANCE,VAR_POP,VARIANCE_POP,VAR,POP diff --git a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_and.md b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_and.md index 9a8ba628b94eea..9e342842ed442e 100644 --- a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_and.md +++ b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_and.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# bitmap_and -## description -### Syntax +## bitmap_and +### description +#### Syntax `BITMAP BITMAP_AND(BITMAP lhs, BITMAP rhs)` 计算两个及以上输入bitmap的交集,返回新的bitmap. -## example +### example ``` mysql> select bitmap_count(bitmap_and(to_bitmap(1), to_bitmap(2))) cnt; @@ -78,6 +78,6 @@ MySQL> select bitmap_to_string(bitmap_and(bitmap_from_string('1,2,3'), bitmap_fr +-----------------------------------------------------------------------------------------------------------------------------+ ``` -## keyword +### keywords BITMAP_AND,BITMAP diff --git a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_and_count.md b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_and_count.md index 7e1c1b5cbcdf90..74a43c6d8c2b63 100644 --- a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_and_count.md +++ b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_and_count.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# bitmap_and_count -## description -### Syntax +## bitmap_and_count +### description +#### Syntax `BigIntVal bitmap_and_count(BITMAP lhs, BITMAP rhs, ...)` 计算两个及以上输入bitmap的交集,返回交集的个数. -## example +### example ``` MySQL> select bitmap_and_count(bitmap_from_string('1,2,3'),bitmap_empty()); @@ -79,6 +79,6 @@ MySQL> select bitmap_and_count(bitmap_from_string('1,2,3'), bitmap_from_string(' +-------------------------------------------------------------------------------------------------------------------+ ``` -## keyword +### keywords BITMAP_AND_COUNT,BITMAP diff --git a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_and_not.md b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_and_not.md index 7074d19273923e..d24bcb3a87b9cf 100644 --- a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_and_not.md +++ b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_and_not.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# bitmap_and_not -## description -### Syntax +## bitmap_and_not +### description +#### Syntax `BITMAP BITMAP_AND_NOT(BITMAP lhs, BITMAP rhs)` 将两个bitmap进行与非操作并返回计算结果。 -## example +### example ``` mysql> select bitmap_count(bitmap_and_not(bitmap_from_string('1,2,3'),bitmap_from_string('3,4,5'))) cnt; @@ -43,6 +43,6 @@ mysql> select bitmap_count(bitmap_and_not(bitmap_from_string('1,2,3'),bitmap_fro +------+ ``` -## keyword +### keywords BITMAP_AND_NOT,BITMAP diff --git a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_and_not_count.md b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_and_not_count.md index 509d01a9b4afae..6c9b3b115e211d 100644 --- a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_and_not_count.md +++ b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_and_not_count.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# bitmap_and_not_count -## description -### Syntax +## bitmap_and_not_count +### description +#### Syntax `BITMAP BITMAP_AND_NOT_COUNT(BITMAP lhs, BITMAP rhs)` 将两个bitmap进行与非操作并返回计算返回的大小. -## example +### example ``` mysql> select bitmap_and_not_count(bitmap_from_string('1,2,3'),bitmap_from_string('3,4,5')) cnt; @@ -43,6 +43,6 @@ mysql> select bitmap_and_not_count(bitmap_from_string('1,2,3'),bitmap_from_strin +------+ ``` -## keyword +### keywords BITMAP_AND_NOT_COUNT,BITMAP diff --git a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_contains.md b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_contains.md index 1f3f67c928d706..f7a71e6d6a14e7 100644 --- a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_contains.md +++ b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_contains.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# bitmap_contains -## description -### Syntax +## bitmap_contains +### description +#### Syntax `B00LEAN BITMAP_CONTAINS(BITMAP bitmap, BIGINT input)` 计算输入值是否在Bitmap列中,返回值是Boolean值. -## example +### example ``` mysql> select bitmap_contains(to_bitmap(1),2) cnt; @@ -50,6 +50,6 @@ mysql> select bitmap_contains(to_bitmap(1),1) cnt; +------+ ``` -## keyword +### keywords BITMAP_CONTAINS,BITMAP diff --git a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_empty.md b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_empty.md index e6d3d72707d0ad..b677f5ac110d9f 100644 --- a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_empty.md +++ b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_empty.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# bitmap_empty -## description -### Syntax +## bitmap_empty +### description +#### Syntax `BITMAP BITMAP_EMPTY()` @@ -36,7 +36,7 @@ under the License. cat data | curl --location-trusted -u user:passwd -T - -H "columns: dt,page,v1,v2=bitmap_empty()" http://host:8410/api/test/testDb/_stream_load ``` -## example +### example ``` mysql> select bitmap_count(bitmap_empty()); @@ -47,6 +47,6 @@ mysql> select bitmap_count(bitmap_empty()); +------------------------------+ ``` -## keyword +### keywords BITMAP_EMPTY,BITMAP diff --git a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_from_string.md b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_from_string.md index 355ff946e4a655..d4eb875a156d88 100644 --- a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_from_string.md +++ b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_from_string.md @@ -22,10 +22,10 @@ specific language governing permissions and limitations under the License. --> -# bitmap_from_string +## bitmap_from_string -## description -### Syntax +### description +#### Syntax `BITMAP BITMAP_FROM_STRING(VARCHAR input)` @@ -33,7 +33,7 @@ under the License. 比如"0, 1, 2"字符串会转化为一个Bitmap,其中的第0, 1, 2位被设置. 当输入字段不合法时,返回NULL -## example +### example ``` mysql> select bitmap_to_string(bitmap_empty()); @@ -58,6 +58,6 @@ mysql> select bitmap_from_string("-1, 0, 1, 2"); +-----------------------------------+ ``` -## keyword +### keywords BITMAP_FROM_STRING,BITMAP diff --git a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_has_all.md b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_has_all.md index 71ec5d80065402..24e2b71a109c8b 100644 --- a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_has_all.md +++ b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_has_all.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# bitmap_has_all -## description -### Syntax +## bitmap_has_all +### description +#### Syntax `B00LEAN BITMAP_HAS_ALL(BITMAP lhs, BITMAP rhs)` 如果第一个bitmap包含第二个bitmap的全部元素,则返回true。 如果第二个bitmap包含的元素为空,返回true。 -## example +### example ``` mysql> select bitmap_has_all(bitmap_from_string("0, 1, 2"), bitmap_from_string("1, 2")) cnt; @@ -51,6 +51,6 @@ mysql> select bitmap_has_all(bitmap_empty(), bitmap_from_string("1, 2")) cnt; +------+ ``` -## keyword +### keywords BITMAP_HAS_ALL,BITMAP diff --git a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_has_any.md b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_has_any.md index 13fc4217322241..7c2ca1bba87a1d 100644 --- a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_has_any.md +++ b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_has_any.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# bitmap_has_any -## description -### Syntax +## bitmap_has_any +### description +#### Syntax `B00LEAN BITMAP_HAS_ANY(BITMAP lhs, BITMAP rhs)` 计算两个Bitmap列是否存在相交元素,返回值是Boolean值. -## example +### example ``` mysql> select bitmap_has_any(to_bitmap(1),to_bitmap(2)) cnt; @@ -50,6 +50,6 @@ mysql> select bitmap_has_any(to_bitmap(1),to_bitmap(1)) cnt; +------+ ``` -## keyword +### keywords BITMAP_HAS_ANY,BITMAP diff --git a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_hash.md b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_hash.md index 76eda65e913d9d..37496a45edce2f 100644 --- a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_hash.md +++ b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_hash.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# bitmap_hash -## description -### Syntax +## bitmap_hash +### description +#### Syntax `BITMAP BITMAP_HASH(expr)` @@ -36,7 +36,7 @@ under the License. cat data | curl --location-trusted -u user:passwd -T - -H "columns: dt,page,device_id, device_id=bitmap_hash(device_id)" http://host:8410/api/test/testDb/_stream_load ``` -## example +### example ``` mysql> select bitmap_count(bitmap_hash('hello')); @@ -47,6 +47,6 @@ mysql> select bitmap_count(bitmap_hash('hello')); +------------------------------------+ ``` -## keyword +### keywords BITMAP_HASH,BITMAP diff --git a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_intersect.md b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_intersect.md index 3b71de439b7c46..d3e9f3242dbfd2 100644 --- a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_intersect.md +++ b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_intersect.md @@ -24,18 +24,18 @@ specific language governing permissions and limitations under the License. --> -# bitmap_intersect -## description +## bitmap_intersect +### description 聚合函数,用于计算分组后的 bitmap 交集。常见使用场景如:计算用户留存率。 -### Syntax +#### Syntax `BITMAP BITMAP_INTERSECT(BITMAP value)` 输入一组 bitmap 值,求这一组 bitmap 值的交集,并返回。 -## example +### example 表结构 @@ -57,6 +57,6 @@ mysql> select tag, bitmap_intersect(user_id) from (select tag, date, bitmap_unio mysql> select tag, bitmap_to_string(bitmap_intersect(user_id)) from (select tag, date, bitmap_union(user_id) user_id from table where date in ('2020-05-18', '2020-05-19') group by tag, date) a group by tag; ``` -## keyword +### keywords BITMAP_INTERSECT, BITMAP diff --git a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_max.md b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_max.md index e9b6e3772fc0bc..b590862870f9af 100644 --- a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_max.md +++ b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_max.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# bitmap_max -## description -### Syntax +## bitmap_max +### description +#### Syntax `BIGINT BITMAP_MAX(BITMAP input)` 计算并返回 bitmap 中的最大值. -## example +### example ``` mysql> select bitmap_max(bitmap_from_string('')) value; @@ -50,6 +50,6 @@ mysql> select bitmap_max(bitmap_from_string('1,9999999999')) value; +------------+ ``` -## keyword +### keywords BITMAP_MAX,BITMAP diff --git a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_min.md b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_min.md index 09e8486189d71b..96ad2eb795e30e 100644 --- a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_min.md +++ b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_min.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# bitmap_min -## description -### Syntax +## bitmap_min +### description +#### Syntax `BIGINT BITMAP_MIN(BITMAP input)` 计算并返回 bitmap 中的最小值. -## example +### example ``` mysql> select bitmap_min(bitmap_from_string('')) value; @@ -50,6 +50,6 @@ mysql> select bitmap_min(bitmap_from_string('1,9999999999')) value; +-------+ ``` -## keyword +### keywords BITMAP_MIN,BITMAP diff --git a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_not.md b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_not.md index 28838941d3b329..d2e27f2a642117 100644 --- a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_not.md +++ b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_not.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# bitmap_not -## description -### Syntax +## bitmap_not +### description +#### Syntax `BITMAP BITMAP_NOT(BITMAP lhs, BITMAP rhs)` 计算lhs减去rhs之后的集合,返回新的bitmap. -## example +### example ``` mysql> select bitmap_count(bitmap_not(bitmap_from_string('2,3'),bitmap_from_string('1,2,3,4'))) cnt; @@ -50,6 +50,6 @@ mysql> select bitmap_to_string(bitmap_not(bitmap_from_string('2,3,5'),bitmap_fro +----------------------------------------------------------------------------------------+ ``` -## keyword +### keywords BITMAP_NOT,BITMAP diff --git a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_or.md b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_or.md index ef0eeaa6af556c..90c5f895902bc1 100644 --- a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_or.md +++ b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_or.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# bitmap_or -## description -### Syntax +## bitmap_or +### description +#### Syntax `BITMAP BITMAP_OR(BITMAP lhs, BITMAP rhs, ...)` 计算两个及以上的输入bitmap的并集,返回新的bitmap. -## example +### example ``` mysql> select bitmap_count(bitmap_or(to_bitmap(1), to_bitmap(2))) cnt; @@ -78,6 +78,6 @@ MySQL> select bitmap_to_string(bitmap_or(to_bitmap(10), bitmap_from_string('1,2' +--------------------------------------------------------------------------------------------------------+ ``` -## keyword +### keywords BITMAP_OR,BITMAP diff --git a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_or_count.md b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_or_count.md index 6e1104bf21dc0f..829f4816e39e42 100644 --- a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_or_count.md +++ b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_or_count.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# bitmap_or_count -## description -### Syntax +## bitmap_or_count +### description +#### Syntax `BigIntVal bitmap_or_count(BITMAP lhs, BITMAP rhs, ...)` 计算两个及以上输入bitmap的并集,返回并集的个数. -## example +### example ``` MySQL> select bitmap_or_count(bitmap_from_string('1,2,3'),bitmap_empty()); @@ -72,6 +72,6 @@ MySQL> select bitmap_or_count(bitmap_from_string('1,2,3'), bitmap_from_string('3 +-------------------------------------------------------------------------------------------------+ ``` -## keyword +### keywords BITMAP_OR_COUNT,BITMAP diff --git a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_subset_in_range.md b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_subset_in_range.md index 5fb673b1ad3fa0..db756f45f842fa 100644 --- a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_subset_in_range.md +++ b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_subset_in_range.md @@ -24,17 +24,17 @@ specific language governing permissions and limitations under the License. --> -# bitmap_subset_in_range +## bitmap_subset_in_range -## Description +### Description -### Syntax +#### Syntax `BITMAP BITMAP_SUBSET_IN_RANGE(BITMAP src, BIGINT range_start, BIGINT range_end)` 返回 BITMAP 指定范围内的子集(不包括范围结束)。 -## example +### example ``` mysql> select bitmap_to_string(bitmap_subset_in_range(bitmap_from_string('1,2,3,4,5'), 0, 9)) value; @@ -52,6 +52,6 @@ mysql> select bitmap_to_string(bitmap_subset_in_range(bitmap_from_string('1,2,3, +-------+ ``` -## keyword +### keywords BITMAP_SUBSET_IN_RANGE,BITMAP_SUBSET,BITMAP diff --git a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_subset_limit.md b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_subset_limit.md index be905b5637045f..50e07c79aaa858 100644 --- a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_subset_limit.md +++ b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_subset_limit.md @@ -24,11 +24,11 @@ specific language governing permissions and limitations under the License. --> -# bitmap_subset_limit +## bitmap_subset_limit -## Description +### Description -### Syntax +#### Syntax `BITMAP BITMAP_SUBSET_LIMIT(BITMAP src, BIGINT range_start, BIGINT cardinality_limit)` @@ -36,7 +36,7 @@ under the License. range_start:范围起始点(含) cardinality_limit:子BIGMAP基数上限 -## example +### example ``` mysql> select bitmap_to_string(bitmap_subset_limit(bitmap_from_string('1,2,3,4,5'), 0, 3)) value; @@ -54,6 +54,6 @@ mysql> select bitmap_to_string(bitmap_subset_limit(bitmap_from_string('1,2,3,4,5 +-------+ ``` -## keyword +### keywords BITMAP_SUBSET_LIMIT,BITMAP_SUBSET,BITMAP diff --git a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_to_string.md b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_to_string.md index ba447171f6ffe0..08e14f2ba3e7ec 100644 --- a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_to_string.md +++ b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_to_string.md @@ -22,16 +22,16 @@ specific language governing permissions and limitations under the License. --> -# bitmap_to_string +## bitmap_to_string -## description -### Syntax +### description +#### Syntax `VARCHAR BITMAP_TO_STRING(BITMAP input)` 将一个bitmap转化成一个逗号分隔的字符串,字符串中包含所有设置的BIT位。输入是null的话会返回null。 -## example +### example ``` mysql> select bitmap_to_string(null); @@ -64,6 +64,6 @@ mysql> select bitmap_to_string(bitmap_or(to_bitmap(1), to_bitmap(2))); ``` -## keyword +### keywords BITMAP_TO_STRING,BITMAP diff --git a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_union.md b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_union.md index 8dde6b4fb1863f..2bad22bdeecc37 100644 --- a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_union.md +++ b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_union.md @@ -24,19 +24,19 @@ specific language governing permissions and limitations under the License. --> -# bitmap_union function +## bitmap_union function -## description +### description 聚合函数,用于计算分组后的 bitmap 并集。常见使用场景如:计算PV,UV。 -### Syntax +#### Syntax `BITMAP BITMAP_UNION(BITMAP value)` 输入一组 bitmap 值,求这一组 bitmap 值的并集,并返回。 -## example +### example ``` mysql> select page_id, bitmap_union(user_id) from table group by page_id; @@ -54,6 +54,6 @@ mysql> select page_id, bitmap_count(bitmap_union(user_id)) from table group by p mysql> select page_id, count(distinct user_id) from table group by page_id; ``` -## keyword +### keywords BITMAP_UNION, BITMAP diff --git a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_xor.md b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_xor.md index a50cdbca16170a..8140bda1d4eb61 100644 --- a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_xor.md +++ b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_xor.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# bitmap_xor -## description -### Syntax +## bitmap_xor +### description +#### Syntax `BITMAP BITMAP_XOR(BITMAP lhs, BITMAP rhs, ...)` 计算两个及以上输入bitmap的差集,返回新的bitmap. -## example +### example ``` mysql> select bitmap_count(bitmap_xor(bitmap_from_string('2,3'),bitmap_from_string('1,2,3,4'))) cnt; @@ -71,6 +71,6 @@ MySQL> select bitmap_to_string(bitmap_xor(bitmap_from_string('2,3'),bitmap_from_ +---------------------------------------------------------------------------------------------------------------------------+ ``` -## keyword +### keywords BITMAP_XOR,BITMAP diff --git a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_xor_count.md b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_xor_count.md index 65b0a7e64fc971..062b35381bf179 100644 --- a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_xor_count.md +++ b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/bitmap_xor_count.md @@ -22,17 +22,17 @@ specific language governing permissions and limitations under the License. --> -# bitmap_xor_count +## bitmap_xor_count -## description +### description -### Syntax +#### Syntax `BIGINT BITMAP_XOR_COUNT(BITMAP lhs, BITMAP rhs, ...)` 将两个及以上bitmap集合进行异或操作并返回结果集的大小 -## example +### example ``` mysql> select bitmap_xor_count(bitmap_from_string('1,2,3'),bitmap_from_string('3,4,5')); @@ -78,7 +78,7 @@ MySQL> select (bitmap_xor_count(bitmap_from_string('2,3'),bitmap_from_string('1, +-----------------------------------------------------------------------------------------------------------------+ ``` -## keyword +### keywords BITMAP_XOR_COUNT,BITMAP diff --git a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/orthogonal_bitmap_intersect.md b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/orthogonal_bitmap_intersect.md index 6d98be6699bd43..45e67d6ab68972 100644 --- a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/orthogonal_bitmap_intersect.md +++ b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/orthogonal_bitmap_intersect.md @@ -22,14 +22,14 @@ specific language governing permissions and limitations under the License. --> -# orthogonal_bitmap_intersect -## description -### Syntax +## orthogonal_bitmap_intersect +### description +#### Syntax `BITMAP ORTHOGONAL_BITMAP_INTERSECT(bitmap_column, column_to_filter, filter_values)` 求bitmap交集函数, 第一个参数是Bitmap列,第二个参数是用来过滤的维度列,第三个参数是变长参数,含义是过滤维度列的不同取值 -## example +### example ``` mysql> select orthogonal_bitmap_intersect(members, tag_group, 1150000, 1150001, 390006) from tag_map where tag_group in ( 1150000, 1150001, 390006); @@ -42,6 +42,6 @@ mysql> select orthogonal_bitmap_intersect(members, tag_group, 1150000, 1150001, ``` -## keyword +### keywords ORTHOGONAL_BITMAP_INTERSECT,BITMAP diff --git a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/orthogonal_bitmap_intersect_count.md b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/orthogonal_bitmap_intersect_count.md index 6a033d2fa2c0ea..6cf79490290d24 100644 --- a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/orthogonal_bitmap_intersect_count.md +++ b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/orthogonal_bitmap_intersect_count.md @@ -22,14 +22,14 @@ specific language governing permissions and limitations under the License. --> -# orthogonal_bitmap_intersect_count -## description -### Syntax +## orthogonal_bitmap_intersect_count +### description +#### Syntax `BITMAP ORTHOGONAL_BITMAP_INTERSECT_COUNT(bitmap_column, column_to_filter, filter_values)` 求bitmap交集大小的函数, 第一个参数是Bitmap列,第二个参数是用来过滤的维度列,第三个参数是变长参数,含义是过滤维度列的不同取值 -## example +### example ``` mysql> select orthogonal_bitmap_intersect_count(members, tag_group, 1150000, 1150001, 390006) from tag_map where tag_group in ( 1150000, 1150001, 390006); @@ -41,6 +41,6 @@ mysql> select orthogonal_bitmap_intersect_count(members, tag_group, 1150000, 115 1 row in set (3.382 sec) ``` -## keyword +### keywords ORTHOGONAL_BITMAP_INTERSECT_COUNT,BITMAP diff --git a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/orthogonal_bitmap_union_count.md b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/orthogonal_bitmap_union_count.md index f964b8312ab441..c08fd16c269557 100644 --- a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/orthogonal_bitmap_union_count.md +++ b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/orthogonal_bitmap_union_count.md @@ -22,15 +22,15 @@ specific language governing permissions and limitations under the License. --> -# orthogonal_bitmap_union_count -## description -### Syntax +## orthogonal_bitmap_union_count +### description +#### Syntax `BITMAP ORTHOGONAL_BITMAP_UNION_COUNT(bitmap_column, column_to_filter, filter_values)` 求bitmap并集大小的函数, 参数类型是bitmap,是待求并集count的列 -## example +### example ``` mysql> select orthogonal_bitmap_union_count(members) from tag_map where tag_group in ( 1150000, 1150001, 390006); @@ -42,6 +42,6 @@ mysql> select orthogonal_bitmap_union_count(members) from tag_map where tag_gro 1 row in set (2.645 sec) ``` -## keyword +### keywords - ORTHOGONAL_BITMAP_UNION_COUNT,BITMAP \ No newline at end of file + ORTHOGONAL_BITMAP_UNION_COUNT,BITMAP diff --git a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/sub_bitmap.md b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/sub_bitmap.md index 211825073c2a58..05d939bfce1f70 100644 --- a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/sub_bitmap.md +++ b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/sub_bitmap.md @@ -22,17 +22,17 @@ specific language governing permissions and limitations under the License. --> -# sub_bitmap +## sub_bitmap -## Description +### Description -### Syntax +#### Syntax `BITMAP SUB_BITMAP(BITMAP src, BIGINT offset, BIGINT cardinality_limit)` 从 offset 指定位置开始,截取 cardinality_limit 个 bitmap 元素,返回一个 bitmap 子集。 -## example +### example ``` mysql> select bitmap_to_string(sub_bitmap(bitmap_from_string('1,0,1,2,3,1,5'), 0, 3)) value; @@ -57,6 +57,6 @@ mysql> select bitmap_to_string(sub_bitmap(bitmap_from_string('1,0,1,2,3,1,5'), 2 +-------+ ``` -## keyword +### keywords - SUB_BITMAP,BITMAP_SUBSET,BITMAP \ No newline at end of file + SUB_BITMAP,BITMAP_SUBSET,BITMAP diff --git a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/to_bitmap.md b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/to_bitmap.md index 022e6d75998127..a7f06c8d85c96a 100644 --- a/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/to_bitmap.md +++ b/docs/zh-CN/sql-manual/sql-functions/bitmap-functions/to_bitmap.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# to_bitmap -## description -### Syntax +## to_bitmap +### description +#### Syntax `BITMAP TO_BITMAP(expr)` @@ -38,7 +38,7 @@ under the License. cat data | curl --location-trusted -u user:passwd -T - -H "columns: dt,page,user_id, user_id=to_bitmap(user_id)" http://host:8410/api/test/testDb/_stream_load ``` -## example +### example ``` mysql> select bitmap_count(to_bitmap(10)); @@ -56,6 +56,6 @@ MySQL> select bitmap_to_string(to_bitmap(-1)); +---------------------------------+ ``` -## keyword +### keywords TO_BITMAP,BITMAP diff --git a/docs/zh-CN/sql-manual/sql-functions/bitwise-functions/bitand.md b/docs/zh-CN/sql-manual/sql-functions/bitwise-functions/bitand.md index c7883811831cff..e6c66071c1aa10 100644 --- a/docs/zh-CN/sql-manual/sql-functions/bitwise-functions/bitand.md +++ b/docs/zh-CN/sql-manual/sql-functions/bitwise-functions/bitand.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# bitand -## description -### Syntax +## bitand +### description +#### Syntax `BITAND(Integer-type lhs, Integer-type rhs)` @@ -34,7 +34,7 @@ under the License. 整数范围:TINYINT、SMALLINT、INT、BIGINT、LARGEINT -## example +### example ``` mysql> select bitand(3,5) ans; @@ -52,6 +52,6 @@ mysql> select bitand(4,7) ans; +------+ ``` -## keyword +### keywords BITAND diff --git a/docs/zh-CN/sql-manual/sql-functions/bitwise-functions/bitnot.md b/docs/zh-CN/sql-manual/sql-functions/bitwise-functions/bitnot.md index 8ad791189847e3..de0ab0149157e1 100644 --- a/docs/zh-CN/sql-manual/sql-functions/bitwise-functions/bitnot.md +++ b/docs/zh-CN/sql-manual/sql-functions/bitwise-functions/bitnot.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# bitnot -## description -### Syntax +## bitnot +### description +#### Syntax `BITNOT(Integer-type value)` @@ -34,7 +34,7 @@ under the License. 整数范围:TINYINT、SMALLINT、INT、BIGINT、LARGEINT -## example +### example ``` mysql> select bitnot(7) ans; @@ -52,6 +52,6 @@ mysql> select bitxor(-127) ans; +------+ ``` -## keyword +### keywords BITNOT diff --git a/docs/zh-CN/sql-manual/sql-functions/bitwise-functions/bitor.md b/docs/zh-CN/sql-manual/sql-functions/bitwise-functions/bitor.md index c8fb159eb545c4..278b3637d14601 100644 --- a/docs/zh-CN/sql-manual/sql-functions/bitwise-functions/bitor.md +++ b/docs/zh-CN/sql-manual/sql-functions/bitwise-functions/bitor.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# bitor -## description -### Syntax +## bitor +### description +#### Syntax `BITOR(Integer-type lhs, Integer-type rhs)` @@ -34,7 +34,7 @@ under the License. 整数范围:TINYINT、SMALLINT、INT、BIGINT、LARGEINT -## example +### example ``` mysql> select bitor(3,5) ans; @@ -52,6 +52,6 @@ mysql> select bitand(4,7) ans; +------+ ``` -## keyword +### keywords BITOR diff --git a/docs/zh-CN/sql-manual/sql-functions/bitwise-functions/bitxor.md b/docs/zh-CN/sql-manual/sql-functions/bitwise-functions/bitxor.md index e3f4655eaac92f..14d54526ef81d0 100644 --- a/docs/zh-CN/sql-manual/sql-functions/bitwise-functions/bitxor.md +++ b/docs/zh-CN/sql-manual/sql-functions/bitwise-functions/bitxor.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# bitxor -## description -### Syntax +## bitxor +### description +#### Syntax `BITXOR(Integer-type lhs, Integer-type rhs)` @@ -34,7 +34,7 @@ under the License. 整数范围:TINYINT、SMALLINT、INT、BIGINT、LARGEINT -## example +### example ``` mysql> select bitxor(3,5) ans; @@ -52,6 +52,6 @@ mysql> select bitxor(1,7) ans; +------+ ``` -## keyword +### keywords BITXOR diff --git a/docs/zh-CN/sql-manual/sql-functions/cast.md b/docs/zh-CN/sql-manual/sql-functions/cast.md index 45b017382e377e..f19b2df078ab5f 100644 --- a/docs/zh-CN/sql-manual/sql-functions/cast.md +++ b/docs/zh-CN/sql-manual/sql-functions/cast.md @@ -24,17 +24,17 @@ specific language governing permissions and limitations under the License. --> -# CAST -## description -### Syntax +## CAST +### description +#### Syntax ``` cast (input as type) ``` -### BIGINT type +#### BIGINT type -### Syntax(BIGINT) +#### Syntax(BIGINT) ``` cast (input as BIGINT) ``` @@ -44,7 +44,7 @@ cast (input as type) 将当前列 input 转换为 BIGINT 类型 -## example +### example 1. 转常量,或表中某列 @@ -78,5 +78,5 @@ mysql> select cast(cast ("11.2" as double) as bigint); +----------------------------------------+ 1 row in set (0.00 sec) ``` -## keyword +### keywords CAST diff --git a/docs/zh-CN/sql-manual/sql-functions/conditional-functions/case.md b/docs/zh-CN/sql-manual/sql-functions/conditional-functions/case.md index b1ac6376ae7a18..db9554ec8a258a 100644 --- a/docs/zh-CN/sql-manual/sql-functions/conditional-functions/case.md +++ b/docs/zh-CN/sql-manual/sql-functions/conditional-functions/case.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# case -## description -### Syntax +## case +### description +#### Syntax ``` CASE expression @@ -49,7 +49,7 @@ END 将表达式和多个可能的值进行比较,当匹配时返回相应的结果 -## example +### example ``` mysql> select user_id, case user_id when 1 then 'user_id = 1' when 2 then 'user_id = 2' else 'user_id not exist' end test_case from test; @@ -68,5 +68,5 @@ mysql> select user_id, case when user_id = 1 then 'user_id = 1' when user_id = 2 | 2 | user_id = 2 | +---------+-------------+ ``` -## keyword +### keywords CASE diff --git a/docs/zh-CN/sql-manual/sql-functions/conditional-functions/coalesce.md b/docs/zh-CN/sql-manual/sql-functions/conditional-functions/coalesce.md index 5e55515f9a95ee..354d1bf3d251a2 100644 --- a/docs/zh-CN/sql-manual/sql-functions/conditional-functions/coalesce.md +++ b/docs/zh-CN/sql-manual/sql-functions/conditional-functions/coalesce.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# coalesce -## description -### Syntax +## coalesce +### description +#### Syntax `coalesce(expr1, expr2, ...., expr_n))` 返回参数中的第一个非空表达式(从左向右) -## example +### example ``` mysql> select coalesce(NULL, '1111', '0000'); @@ -42,6 +42,6 @@ mysql> select coalesce(NULL, '1111', '0000'); | 1111 | +--------------------------------+ ``` -## keyword +### keywords COALESCE diff --git a/docs/zh-CN/sql-manual/sql-functions/conditional-functions/if.md b/docs/zh-CN/sql-manual/sql-functions/conditional-functions/if.md index 2f0aea1011b8be..4000c3da93c64e 100644 --- a/docs/zh-CN/sql-manual/sql-functions/conditional-functions/if.md +++ b/docs/zh-CN/sql-manual/sql-functions/conditional-functions/if.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# if -## description -### Syntax +## if +### description +#### Syntax `if(boolean condition, type valueTrue, type valueFalseOrNull)` @@ -35,7 +35,7 @@ under the License. 返回类型: valueTrue 表达式结果的类型 -## example +### example ``` mysql> select user_id, if(user_id = 1, "true", "false") test_if from test; @@ -46,5 +46,5 @@ mysql> select user_id, if(user_id = 1, "true", "false") test_if from test; | 2 | false | +---------+---------+ ``` -## keyword +### keywords IF diff --git a/docs/zh-CN/sql-manual/sql-functions/conditional-functions/ifnull.md b/docs/zh-CN/sql-manual/sql-functions/conditional-functions/ifnull.md index 1546d81a55c545..ebd001f4cc4ac5 100644 --- a/docs/zh-CN/sql-manual/sql-functions/conditional-functions/ifnull.md +++ b/docs/zh-CN/sql-manual/sql-functions/conditional-functions/ifnull.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# ifnull -## description -### Syntax +## ifnull +### description +#### Syntax `ifnull(expr1, expr2)` 如果 expr1 的值不为 NULL 则返回 expr1,否则返回 expr2 -## example +### example ``` mysql> select ifnull(1,0); @@ -50,5 +50,5 @@ mysql> select ifnull(null,10); | 10 | +------------------+ ``` -## keyword +### keywords IFNULL diff --git a/docs/zh-CN/sql-manual/sql-functions/conditional-functions/nullif.md b/docs/zh-CN/sql-manual/sql-functions/conditional-functions/nullif.md index d5d66b658d99a5..f3dbb831de6de8 100644 --- a/docs/zh-CN/sql-manual/sql-functions/conditional-functions/nullif.md +++ b/docs/zh-CN/sql-manual/sql-functions/conditional-functions/nullif.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# nullif -## description -### Syntax +## nullif +### description +#### Syntax `nullif(expr1, expr2)` @@ -40,7 +40,7 @@ CASE END ``` -## example +### example ``` mysql> select nullif(1,1); @@ -57,5 +57,5 @@ mysql> select nullif(1,0); | 1 | +--------------+ ``` -## keyword +### keywords NULLIF diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/convert_tz.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/convert_tz.md index f29bd819938b92..c28b9038ef007d 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/convert_tz.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/convert_tz.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# convert_tz -## description -### Syntax +## convert_tz +### description +#### Syntax `DATETIME CONVERT_TZ(DATETIME dt, VARCHAR from_tz, VARCHAR to_tz)` 转换datetime值,从 from_tz 给定时区转到 to_tz 给定时区,并返回结果值。 如果参数无效该函数返回NULL。 -## Example +### Example ``` mysql> select convert_tz('2019-08-01 13:21:03', 'Asia/Shanghai', 'America/Los_Angeles'); @@ -50,6 +50,6 @@ mysql> select convert_tz('2019-08-01 13:21:03', '+08:00', 'America/Los_Angeles') +--------------------------------------------------------------------+ ``` -## keyword +### keywords CONVERT_TZ diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/curdate.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/curdate.md index 8dbbce9e932dc2..f9fe6663c3fa07 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/curdate.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/curdate.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# curdate,current_date -## description -### Syntax +## curdate,current_date +### description +#### Syntax `DATE CURDATE()` 获取当前的日期,以DATE类型返回 -## Examples +### Examples ``` mysql> SELECT CURDATE(); @@ -50,6 +50,6 @@ mysql> SELECT CURDATE() + 0; +---------------+ ``` -## keyword +### keywords CURDATE,CURRENT_DATE diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/current_timestamp.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/current_timestamp.md index 1a1e99df3599f9..53ca1dfeed531f 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/current_timestamp.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/current_timestamp.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# current_timestamp -## description -### Syntax +## current_timestamp +### description +#### Syntax `DATETIME CURRENT_TIMESTAMP()` 获得当前的时间,以Datetime类型返回 -## example +### example ``` mysql> select current_timestamp(); @@ -44,6 +44,6 @@ mysql> select current_timestamp(); +---------------------+ ``` -## keyword +### keywords CURRENT_TIMESTAMP,CURRENT,TIMESTAMP diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/curtime.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/curtime.md index 19ed78811bcf3f..acefa1eac3e281 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/curtime.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/curtime.md @@ -24,17 +24,17 @@ specific language governing permissions and limitations under the License. --> -# curtime,current_time +## curtime,current_time -## Syntax +### Syntax `TIME CURTIME()` -## Description +### Description 获得当前的时间,以TIME类型返回 -## Examples +### Examples ``` mysql> select current_time(); @@ -45,6 +45,6 @@ mysql> select current_time(); +----------------+ ``` -## keyword +### keywords CURTIME,CURRENT_TIME diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/date_add.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/date_add.md index 1299bcdd4541cd..94997d658f616e 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/date_add.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/date_add.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# date_add -## description -### Syntax +## date_add +### description +#### Syntax `INT DATE_ADD(DATETIME date,INTERVAL expr type)` @@ -39,7 +39,7 @@ expr 参数是您希望添加的时间间隔。 type 参数可以是下列值:YEAR, MONTH, DAY, HOUR, MINUTE, SECOND -## example +### example ``` mysql> select date_add('2010-11-30 23:59:59', INTERVAL 2 DAY); @@ -50,6 +50,6 @@ mysql> select date_add('2010-11-30 23:59:59', INTERVAL 2 DAY); +-------------------------------------------------+ ``` -## keyword +### keywords DATE_ADD,DATE,ADD diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/date_format.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/date_format.md index e2621d4a4690cb..5af190fd8eb9d8 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/date_format.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/date_format.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# date_format -## description -### Syntax +## date_format +### description +#### Syntax `VARCHAR DATE_FORMAT(DATETIME date, VARCHAR format)` @@ -110,7 +110,7 @@ yyyy-MM-dd yyyy-MM-dd HH:mm:ss -## example +### example ``` mysql> select date_format('2009-10-04 22:23:00', '%W %M %Y'); @@ -163,6 +163,6 @@ mysql> select date_format('2006-06-01', '%%%d'); +--------------------------------------------+ ``` -## keyword +### keywords DATE_FORMAT,DATE,FORMAT diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/date_sub.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/date_sub.md index d0d30244ad98cb..6ca944be36eedd 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/date_sub.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/date_sub.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# date_sub -## description -### Syntax +## date_sub +### description +#### Syntax `INT DATE_SUB(DATETIME date,INTERVAL expr type)` @@ -39,7 +39,7 @@ expr 参数是您希望添加的时间间隔。 type 参数可以是下列值:YEAR, MONTH, DAY, HOUR, MINUTE, SECOND -## example +### example ``` mysql> select date_sub('2010-11-30 23:59:59', INTERVAL 2 DAY); @@ -50,6 +50,6 @@ mysql> select date_sub('2010-11-30 23:59:59', INTERVAL 2 DAY); +-------------------------------------------------+ ``` -## keyword +### keywords DATE_SUB,DATE,SUB diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/datediff.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/datediff.md index 5d83c5572a296d..97c93b3c395c29 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/datediff.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/datediff.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# datediff -## description -### Syntax +## datediff +### description +#### Syntax `DATETIME DATEDIFF(DATETIME expr1,DATETIME expr2)` @@ -37,7 +37,7 @@ expr1 和 expr2 参数是合法的日期或日期/时间表达式。 注释:只有值的日期部分参与计算。 -## example +### example ``` mysql> select datediff(CAST('2007-12-31 23:59:59' AS DATETIME), CAST('2007-12-30' AS DATETIME)); @@ -54,5 +54,5 @@ mysql> select datediff(CAST('2010-11-30 23:59:59' AS DATETIME), CAST('2010-12-31 | -31 | +-----------------------------------------------------------------------------------+ ``` -## keyword +### keywords DATEDIFF diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/day.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/day.md index f75aa6e5715efc..f980840af95877 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/day.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/day.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# day -## description -### Syntax +## day +### description +#### Syntax `INT DAY(DATETIME date)` @@ -35,7 +35,7 @@ under the License. 参数为Date或者Datetime类型 -## example +### example ``` mysql> select day('1987-01-31'); @@ -45,5 +45,5 @@ mysql> select day('1987-01-31'); | 31 | +----------------------------+ ``` -## keyword +### keywords DAY diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/dayname.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/dayname.md index f0905cc62481f7..1349ebd321e1a3 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/dayname.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/dayname.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# dayname -## description -### Syntax +## dayname +### description +#### Syntax `VARCHAR DAYNAME(DATE)` @@ -35,7 +35,7 @@ under the License. 参数为Date或者Datetime类型 -## example +### example ``` mysql> select dayname('2007-02-03 00:00:00'); @@ -46,5 +46,5 @@ mysql> select dayname('2007-02-03 00:00:00'); +--------------------------------+ ``` -## keyword +### keywords DAYNAME diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/dayofmonth.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/dayofmonth.md index b5c9bfd7403610..5a5d132333a016 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/dayofmonth.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/dayofmonth.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# dayofmonth -## description -### Syntax +## dayofmonth +### description +#### Syntax `INT DAYOFMONTH(DATETIME date)` @@ -35,7 +35,7 @@ under the License. 参数为Date或者Datetime类型 -## example +### example ``` mysql> select dayofmonth('1987-01-31'); @@ -46,6 +46,6 @@ mysql> select dayofmonth('1987-01-31'); +-----------------------------------+ ``` -## keyword +### keywords DAYOFMONTH diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/dayofweek.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/dayofweek.md index 3cddb1395ffa42..33090f8392f9db 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/dayofweek.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/dayofweek.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# dayofweek -## description -### Syntax +## dayofweek +### description +#### Syntax `INT DAYOFWEEK(DATETIME date)` @@ -35,7 +35,7 @@ DAYOFWEEK函数返回日期的工作日索引值,即星期日为1,星期一 参数为Date或者Datetime类型或者可以cast为Date或者Datetime类型的数字 -## example +### example ``` mysql> select dayofweek('2019-06-25'); @@ -53,6 +53,6 @@ mysql> select dayofweek(cast(20190625 as date)); +-----------------------------------+ ``` -## keyword +### keywords DAYOFWEEK diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/dayofyear.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/dayofyear.md index 25381120603162..8a0a14e41dbb4c 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/dayofyear.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/dayofyear.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# dayofyear -## description -### Syntax +## dayofyear +### description +#### Syntax `INT DAYOFYEAR(DATETIME date)` @@ -35,7 +35,7 @@ under the License. 参数为Date或者Datetime类型 -## example +### example ``` mysql> select dayofyear('2007-02-03 00:00:00'); @@ -46,6 +46,6 @@ mysql> select dayofyear('2007-02-03 00:00:00'); +----------------------------------+ ``` -## keyword +### keywords DAYOFYEAR diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/from_days.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/from_days.md index a02fb5005c0c14..883a8e9ee5131f 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/from_days.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/from_days.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# from_days -## description -### Syntax +## from_days +### description +#### Syntax `DATE FROM_DAYS(INT N)` 通过距离0000-01-01日的天数计算出哪一天 -## example +### example ``` mysql> select from_days(730669); @@ -44,6 +44,6 @@ mysql> select from_days(730669); +-------------------+ ``` -## keyword +### keywords FROM_DAYS,FROM,DAYS diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/from_unixtime.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/from_unixtime.md index 29a37b75e99163..105852b23494c2 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/from_unixtime.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/from_unixtime.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# from_unixtime -## description -### Syntax +## from_unixtime +### description +#### Syntax `DATETIME FROM_UNIXTIME(INT unix_timestamp[, VARCHAR string_format])` @@ -43,7 +43,7 @@ under the License. 1970-01-01 00:00:00 ~ 9999-12-31 23:59:59 -## example +### example ``` mysql> select from_unixtime(1196440219); @@ -75,6 +75,6 @@ mysql> select from_unixtime(1196440219, '%Y-%m-%d %H:%i:%s'); +--------------------------------------------------+ ``` -## keyword +### keywords FROM_UNIXTIME,FROM,UNIXTIME diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/hour.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/hour.md index a0e5a0bcc5c673..81343b95eef054 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/hour.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/hour.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# hour -## description -### Syntax +## hour +### description +#### Syntax `INT HOUR(DATETIME date)` @@ -35,7 +35,7 @@ under the License. 参数为Date或者Datetime类型 -## example +### example ``` mysql> select hour('2018-12-31 23:59:59'); @@ -45,5 +45,5 @@ mysql> select hour('2018-12-31 23:59:59'); | 23 | +-----------------------------+ ``` -## keyword +### keywords HOUR diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/makedate.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/makedate.md index 2d1f94e7b1ec45..336f5e4c61ad4f 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/makedate.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/makedate.md @@ -24,14 +24,14 @@ specific language governing permissions and limitations under the License. --> -# makedate -## description -### Syntax +## makedate +### description +#### Syntax `DATE MAKEDATE(INT year, INT dayofyear)` 返回指定年份和dayofyear构建的日期。dayofyear必须大于0,否则结果为空。 -## example +### example ``` mysql> select makedate(2021,1), makedate(2021,100), makedate(2021,400); +-------------------+---------------------+---------------------+ @@ -41,6 +41,6 @@ mysql> select makedate(2021,1), makedate(2021,100), makedate(2021,400); +-------------------+---------------------+---------------------+ ``` -## keyword +### keywords YEARWEEK diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/minute.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/minute.md index 18adc66f344b49..380e9228d114e4 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/minute.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/minute.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# minute -## description -### Syntax +## minute +### description +#### Syntax `INT MINUTE(DATETIME date)` @@ -35,7 +35,7 @@ under the License. 参数为Date或者Datetime类型 -## example +### example ``` mysql> select minute('2018-12-31 23:59:59'); @@ -45,5 +45,5 @@ mysql> select minute('2018-12-31 23:59:59'); | 59 | +-----------------------------+ ``` -## keyword +### keywords MINUTE diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/month.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/month.md index 718857d737ff18..590677f21fe13b 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/month.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/month.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# month -## description -### Syntax +## month +### description +#### Syntax `INT MONTH(DATETIME date)` @@ -35,7 +35,7 @@ under the License. 参数为Date或者Datetime类型 -## example +### example ``` mysql> select month('1987-01-01'); @@ -46,6 +46,6 @@ mysql> select month('1987-01-01'); +-----------------------------+ ``` -## keyword +### keywords MONTH diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/monthname.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/monthname.md index 3ab0684a49d34d..27a64b5716d69b 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/monthname.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/monthname.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# monthname -## description -### Syntax +## monthname +### description +#### Syntax `VARCHAR MONTHNAME(DATE)` @@ -35,7 +35,7 @@ under the License. 参数为Date或者Datetime类型 -## example +### example ``` mysql> select monthname('2008-02-03 00:00:00'); @@ -46,6 +46,6 @@ mysql> select monthname('2008-02-03 00:00:00'); +----------------------------------+ ``` -## keyword +### keywords MONTHNAME diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/now.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/now.md index 37bd00cdeb1055..454a6ce61d811a 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/now.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/now.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# now -## description -### Syntax +## now +### description +#### Syntax `DATETIME NOW()` 获得当前的时间,以Datetime类型返回 -## example +### example ``` mysql> select now(); @@ -44,6 +44,6 @@ mysql> select now(); +---------------------+ ``` -## keyword +### keywords NOW diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/second.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/second.md index 17a0cc035b705b..818a8be0c5eb66 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/second.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/second.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# second -## description -### Syntax +## second +### description +#### Syntax `INT SECOND(DATETIME date)` @@ -35,7 +35,7 @@ under the License. 参数为Date或者Datetime类型 -## example +### example ``` mysql> select second('2018-12-31 23:59:59'); @@ -45,5 +45,5 @@ mysql> select second('2018-12-31 23:59:59'); | 59 | +-----------------------------+ ``` -## keyword +### keywords SECOND diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/str_to_date.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/str_to_date.md index 3102542d019bde..ffa2c65d783e1e 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/str_to_date.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/str_to_date.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# str_to_date -## description -### Syntax +## str_to_date +### description +#### Syntax `DATETIME STR_TO_DATE(VARCHAR str, VARCHAR format)` @@ -34,7 +34,7 @@ under the License. 支持的format格式与date_format一致 -## example +### example ``` mysql> select str_to_date('2014-12-21 12:34:56', '%Y-%m-%d %H:%i:%s'); @@ -67,6 +67,6 @@ mysql> select str_to_date("2020-09-01", "%Y-%m-%d %H:%i:%s"); 1 row in set (0.01 sec) ``` -## keyword +### keywords STR_TO_DATE,STR,TO,DATE diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/time_round.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/time_round.md index 2e8d142b7c3c6b..60812dc1b687b6 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/time_round.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/time_round.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# time_round -## description -### Syntax +## time_round +### description +#### Syntax `DATETIME TIME_ROUND(DATETIME expr)` @@ -46,7 +46,7 @@ under the License. - `origin` 指定周期的开始时间,默认为 `1970-01-01T00:00:00`,`WEEK` 的默认开始时间为 `1970-01-04T00:00:00`,即周日。可以比 `expr` 大。 - 请尽量选择常见 `period`,如 3 `MONTH`,90 `MINUTE` 等,如设置了非常用 `period`,请同时指定 `origin`。 -## example +### example ``` @@ -82,5 +82,5 @@ MySQL> SELECT MONTH_CEIL(CAST('2020-02-02 13:09:20' AS DATETIME), 3, CAST('1970- +-------------------------------------------------------------------------------------------------+ ``` -## keyword +### keywords TIME_ROUND diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/timediff.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/timediff.md index 22a1b74549a86e..4ae8c7a97bfaac 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/timediff.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/timediff.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# timediff -## description -### Syntax +## timediff +### description +#### Syntax `TIME TIMEDIFF(DATETIME expr1, DATETIME expr2)` @@ -35,7 +35,7 @@ TIMEDIFF返回两个DATETIME之间的差值 TIMEDIFF函数返回表示为时间值的expr1 - expr2的结果,返回值为TIME类型 -## example +### example ``` mysql> SELECT TIMEDIFF(now(),utc_timestamp()); @@ -60,6 +60,6 @@ mysql> SELECT TIMEDIFF('2019-01-01 00:00:00', NULL); +---------------------------------------+ ``` -## keyword +### keywords TIMEDIFF diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/timestampadd.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/timestampadd.md index 3a6aba5d532ed6..f30d50e2cf4e28 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/timestampadd.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/timestampadd.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# timestampadd -## description -### Syntax +## timestampadd +### description +#### Syntax `DATETIME TIMESTAMPADD(unit, interval, DATETIME datetime_expr)` @@ -37,7 +37,7 @@ interval的单位由unit参数给出,它应该是下列值之一: SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, or YEAR。 -## example +### example ``` @@ -55,5 +55,5 @@ mysql> SELECT TIMESTAMPADD(WEEK,1,'2019-01-02'); | 2019-01-09 00:00:00 | +----------------------------------------------+ ``` -## keyword +### keywords TIMESTAMPADD diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/timestampdiff.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/timestampdiff.md index d0108633ae23ce..7edbea2dc42155 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/timestampdiff.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/timestampdiff.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# timestampdiff -## description -### Syntax +## timestampdiff +### description +#### Syntax `INT TIMESTAMPDIFF(unit,DATETIME datetime_expr1, DATETIME datetime_expr2)` @@ -36,7 +36,7 @@ under the License. SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, or YEAR。 -## example +### example ``` @@ -63,5 +63,5 @@ MySQL> SELECT TIMESTAMPDIFF(MINUTE,'2003-02-01','2003-05-01 12:05:55'); +---------------------------------------------------------------------+ ``` -## keyword +### keywords TIMESTAMPDIFF diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/to_date.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/to_date.md index ae07eeda7b4952..1bec7536227cde 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/to_date.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/to_date.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# to_date -## description -### Syntax +## to_date +### description +#### Syntax `DATE TO_DATE(DATETIME)` 返回 DATETIME 类型中的日期部分。 -## example +### example ``` mysql> select to_date("2020-02-02 00:00:00"); @@ -43,6 +43,6 @@ mysql> select to_date("2020-02-02 00:00:00"); +--------------------------------+ ``` -## keyword +### keywords TO_DATE diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/to_days.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/to_days.md index 6498d69c2d145b..fd814f2b462927 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/to_days.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/to_days.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# to_days -## description -### Syntax +## to_days +### description +#### Syntax `INT TO_DAYS(DATETIME date)` @@ -35,7 +35,7 @@ under the License. 参数为Date或者Datetime类型 -## example +### example ``` mysql> select to_days('2007-10-07'); @@ -46,6 +46,6 @@ mysql> select to_days('2007-10-07'); +-----------------------+ ``` -## keyword +### keywords TO_DAYS,TO,DAYS diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/unix_timestamp.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/unix_timestamp.md index 4c8d9aaeaaee6e..8b4a7668c56a29 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/unix_timestamp.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/unix_timestamp.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# unix_timestamp -## description -### Syntax +## unix_timestamp +### description +#### Syntax `INT UNIX_TIMESTAMP(), UNIX_TIMESTAMP(DATETIME date), UNIX_TIMESTAMP(DATETIME date, STRING fmt),` @@ -42,7 +42,7 @@ Format 的格式请参阅 `date_format` 函数的格式说明。 该函数受时区影响。 -## example +### example ``` mysql> select unix_timestamp(); @@ -81,6 +81,6 @@ mysql> select unix_timestamp('1969-01-01 00:00:00'); +---------------------------------------+ ``` -## keyword +### keywords UNIX_TIMESTAMP,UNIX,TIMESTAMP diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/utc_timestamp.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/utc_timestamp.md index 2d061e3b606880..7d9fbdb2aedfd5 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/utc_timestamp.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/utc_timestamp.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# utc_timestamp -## description -### Syntax +## utc_timestamp +### description +#### Syntax `DATETIME UTC_TIMESTAMP()` @@ -37,7 +37,7 @@ under the License. 根据该函数是否用在字符串或数字语境中 -## example +### example ``` mysql> select utc_timestamp(),utc_timestamp() + 1; @@ -48,6 +48,6 @@ mysql> select utc_timestamp(),utc_timestamp() + 1; +---------------------+---------------------+ ``` -## keyword +### keywords UTC_TIMESTAMP,UTC,TIMESTAMP diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/week.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/week.md index 14081a42601df0..4397cf1f64d55c 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/week.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/week.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# week -## description -### Syntax +## week +### description +#### Syntax `INT WEEK(DATE date)` `INT WEEK(DATE date, INT mode)` @@ -46,7 +46,7 @@ under the License. 参数为Date或者Datetime类型 -## example +### example ``` mysql> select week('2020-1-1'); +------------------+ @@ -64,5 +64,5 @@ mysql> select week('2020-7-1',1); +---------------------+ ``` -## keyword +### keywords WEEK diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/weekday.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/weekday.md index e4ec178b96131c..535727cd7faf23 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/weekday.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/weekday.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# weekday -## Description -### Syntax +## weekday +### Description +#### Syntax `INT WEEKDAY (DATETIME date)` @@ -46,7 +46,7 @@ dayofweek | 1 | 2 | 3 | 4 | 5 | 6 | 7 | +-----+-----+-----+-----+-----+-----+-----+ ``` -## example +### example ``` mysql> select weekday('2019-06-25'); @@ -64,5 +64,5 @@ mysql> select weekday(cast(20190625 as date)); +---------------------------------+ ``` -## keyword -WEEKDAY \ No newline at end of file +### keywords +WEEKDAY diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/weekofyear.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/weekofyear.md index 7d2f71fae1d594..7e7d0c01340586 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/weekofyear.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/weekofyear.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# weekofyear -## description -### Syntax +## weekofyear +### description +#### Syntax `INT WEEKOFYEAR(DATETIME date)` @@ -36,7 +36,7 @@ under the License. 参数为Date或者Datetime类型 -## example +### example ``` mysql> select weekofyear('2008-02-20 00:00:00'); @@ -47,6 +47,6 @@ mysql> select weekofyear('2008-02-20 00:00:00'); +-----------------------------------+ ``` -## keyword +### keywords WEEKOFYEAR diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/year.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/year.md index 4e4c39a7dff4ad..21b1693120fab6 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/year.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/year.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# year -## description -### Syntax +## year +### description +#### Syntax `INT YEAR(DATETIME date)` @@ -35,7 +35,7 @@ under the License. 参数为Date或者Datetime类型 -## example +### example ``` mysql> select year('1987-01-01'); @@ -46,6 +46,6 @@ mysql> select year('1987-01-01'); +-----------------------------+ ``` -## keyword +### keywords YEAR diff --git a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/yearweek.md b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/yearweek.md index 6878b9aee055b0..87b5dcf5757b48 100644 --- a/docs/zh-CN/sql-manual/sql-functions/date-time-functions/yearweek.md +++ b/docs/zh-CN/sql-manual/sql-functions/date-time-functions/yearweek.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# yearweek -## description -### Syntax +## yearweek +### description +#### Syntax `INT YEARWEEK(DATE date)` `INT YEARWEEK(DATE date, INT mode)` @@ -48,7 +48,7 @@ under the License. 参数为Date或者Datetime类型 -## example +### example ``` mysql> select yearweek('2021-1-1'); @@ -75,6 +75,6 @@ mysql> select yearweek('2024-12-30',1); +------------------------------------+ ``` -## keyword +### keywords YEARWEEK diff --git a/docs/zh-CN/sql-manual/sql-functions/digital-masking.md b/docs/zh-CN/sql-manual/sql-functions/digital-masking.md index f049a30e9ece98..13be6d97d9ab83 100644 --- a/docs/zh-CN/sql-manual/sql-functions/digital-masking.md +++ b/docs/zh-CN/sql-manual/sql-functions/digital-masking.md @@ -24,11 +24,11 @@ specific language governing permissions and limitations under the License. --> -# DIGITAL_MASKING +## DIGITAL_MASKING -## description +### description -### Syntax +#### Syntax ``` digital_masking(digital_number) @@ -38,7 +38,7 @@ digital_masking(digital_number) 将输入的 `digital_number` 进行脱敏处理,返回遮盖脱敏后的结果。`digital_number` 为 `BIGINT` 数据类型。 -## example +### example 1. 将手机号码进行脱敏处理 @@ -51,6 +51,6 @@ digital_masking(digital_number) +------------------------------+ ``` -## keyword +### keywords DIGITAL_MASKING diff --git a/docs/zh-CN/sql-manual/sql-functions/encrypt-digest-functions/aes.md b/docs/zh-CN/sql-manual/sql-functions/encrypt-digest-functions/aes.md index 8f1770772b3a74..5ae1f14c4848ec 100644 --- a/docs/zh-CN/sql-manual/sql-functions/encrypt-digest-functions/aes.md +++ b/docs/zh-CN/sql-manual/sql-functions/encrypt-digest-functions/aes.md @@ -22,17 +22,17 @@ specific language governing permissions and limitations under the License. --> -# AES_ENCRYPT +## AES_ENCRYPT -## description +### description Aes 加密函数 -### Syntax +#### Syntax `VARCHAR AES_ENCRYPT(str,key_str[,init_vector])` 返回加密后的结果 -## example +### example ``` MySQL > select to_base64(AES_ENCRYPT('text','F3229A0B371ED2D9441B830D21A390C3')); @@ -54,18 +54,21 @@ MySQL > select to_base64(AES_ENCRYPT('text','F3229A0B371ED2D9441B830D21A390C3', +----------------------------------------------------------------------------------+ 1 row in set (0.011 sec) ``` +### keywords -# AES_DECRYPT +AES_ENCRYPT -## description +## AES_DECRYPT + +### description Aes 解密函数 -### Syntax +#### Syntax `VARCHAR AES_DECRYPT(str,key_str[,init_vector])` 返回解密后的结果 -## example +### example ``` MySQL > select AES_DECRYPT(FROM_BASE64('wr2JEDVXzL9+2XtRhgIloA=='),'F3229A0B371ED2D9441B830D21A390C3'); @@ -88,6 +91,6 @@ MySQL > select AES_DECRYPT(FROM_BASE64('mvZT1KJw7N0RJf27aipUpg=='),'F3229A0B371E 1 row in set (0.012 sec) ``` -## keyword +### keywords - AES_ENCRYPT, AES_DECRYPT \ No newline at end of file + AES_DECRYPT diff --git a/docs/zh-CN/sql-manual/sql-functions/encrypt-digest-functions/md5.md b/docs/zh-CN/sql-manual/sql-functions/encrypt-digest-functions/md5.md index 38da45be42e29e..d3ca86b375b0e6 100644 --- a/docs/zh-CN/sql-manual/sql-functions/encrypt-digest-functions/md5.md +++ b/docs/zh-CN/sql-manual/sql-functions/encrypt-digest-functions/md5.md @@ -22,15 +22,15 @@ specific language governing permissions and limitations under the License. --> -# MD5 +## MD5 -## description +### description 计算 MD5 128-bit -### Syntax +#### Syntax `MD5(str)` -## example +### example ``` MySQL [(none)]> select md5("abc"); @@ -42,6 +42,6 @@ MySQL [(none)]> select md5("abc"); 1 row in set (0.013 sec) ``` -## keyword +### keywords - MD5 \ No newline at end of file + MD5 diff --git a/docs/zh-CN/sql-manual/sql-functions/encrypt-digest-functions/md5sum.md b/docs/zh-CN/sql-manual/sql-functions/encrypt-digest-functions/md5sum.md index 9374fc46a0e5a8..683fbcca428c19 100644 --- a/docs/zh-CN/sql-manual/sql-functions/encrypt-digest-functions/md5sum.md +++ b/docs/zh-CN/sql-manual/sql-functions/encrypt-digest-functions/md5sum.md @@ -22,15 +22,15 @@ specific language governing permissions and limitations under the License. --> -# MD5SUM +## MD5SUM -## description +### description 计算 多个字符串 MD5 128-bit -### Syntax +#### Syntax `MD5SUM(str[,str])` -## example +### example ``` MySQL > select md5("abcd"); @@ -51,6 +51,6 @@ MySQL > select md5sum("ab","cd"); ``` -## keyword +### keywords - MD5SUM \ No newline at end of file + MD5SUM diff --git a/docs/zh-CN/sql-manual/sql-functions/encrypt-digest-functions/sm3.md b/docs/zh-CN/sql-manual/sql-functions/encrypt-digest-functions/sm3.md index f0efd68f385e98..20924acf6def44 100644 --- a/docs/zh-CN/sql-manual/sql-functions/encrypt-digest-functions/sm3.md +++ b/docs/zh-CN/sql-manual/sql-functions/encrypt-digest-functions/sm3.md @@ -22,15 +22,15 @@ specific language governing permissions and limitations under the License. --> -# SM3 +## SM3 -## description +### description 计算 SM3 256-bit -### Syntax +#### Syntax `SM3(str)` -## example +### example ``` MySQL > select sm3("abcd"); @@ -42,6 +42,6 @@ MySQL > select sm3("abcd"); 1 row in set (0.009 sec) ``` -## keyword +### keywords - SM3 \ No newline at end of file + SM3 diff --git a/docs/zh-CN/sql-manual/sql-functions/encrypt-digest-functions/sm3sum.md b/docs/zh-CN/sql-manual/sql-functions/encrypt-digest-functions/sm3sum.md index 5f0f9712dade83..a02f8fdb5f69d6 100644 --- a/docs/zh-CN/sql-manual/sql-functions/encrypt-digest-functions/sm3sum.md +++ b/docs/zh-CN/sql-manual/sql-functions/encrypt-digest-functions/sm3sum.md @@ -22,15 +22,15 @@ specific language governing permissions and limitations under the License. --> -# SM3SUM +## SM3SUM -## description +### description 计算 多个字符串 SM3 256-bit -### Syntax +#### Syntax `SM3SUM(str[,str])` -## example +### example ``` MySQL > select sm3("abcd"); @@ -51,6 +51,6 @@ MySQL > select sm3sum("ab","cd"); ``` -## keyword +### keywords - SM3SUM \ No newline at end of file + SM3SUM diff --git a/docs/zh-CN/sql-manual/sql-functions/encrypt-digest-functions/sm4.md b/docs/zh-CN/sql-manual/sql-functions/encrypt-digest-functions/sm4.md index 35b6575fe4d4e1..6c0bbcb2ee851d 100644 --- a/docs/zh-CN/sql-manual/sql-functions/encrypt-digest-functions/sm4.md +++ b/docs/zh-CN/sql-manual/sql-functions/encrypt-digest-functions/sm4.md @@ -22,17 +22,17 @@ specific language governing permissions and limitations under the License. --> -# SM4_ENCRYPT +## SM4_ENCRYPT -## description +### description SM4 加密函数 -### Syntax +#### Syntax `VARCHAR SM4_ENCRYPT(str,key_str[,init_vector])` 返回加密后的结果 -## example +### example ``` MySQL > select TO_BASE64(SM4_ENCRYPT('text','F3229A0B371ED2D9441B830D21A390C3')); @@ -55,17 +55,21 @@ MySQL > select to_base64(SM4_ENCRYPT('text','F3229A0B371ED2D9441B830D21A390C3', 1 row in set (0.014 sec) ``` -# SM4_DECRYPT +### keywords -## description +SM4_ENCRYPT + +## SM4_DECRYPT + +### description Aes 解密函数 -### Syntax +#### Syntax `VARCHAR AES_DECRYPT(str,key_str[,init_vector])` 返回解密后的结果 -## example +### example ``` MySQL [(none)]> select SM4_DECRYPT(FROM_BASE64('aDjwRflBrDjhBZIOFNw3Tg=='),'F3229A0B371ED2D9441B830D21A390C3'); @@ -88,6 +92,6 @@ MySQL > select SM4_DECRYPT(FROM_BASE64('G7yqOKfEyxdagboz6Qf01A=='),'F3229A0B371E 1 row in set (0.012 sec) ``` -## keyword +### keywords - SM4_ENCRYPT, SM4_DECRYPT \ No newline at end of file + SM4_DECRYPT diff --git a/docs/zh-CN/sql-manual/sql-functions/encrypt-dixgest-functions/aes.md b/docs/zh-CN/sql-manual/sql-functions/encrypt-dixgest-functions/aes.md deleted file mode 100644 index 8f1770772b3a74..00000000000000 --- a/docs/zh-CN/sql-manual/sql-functions/encrypt-dixgest-functions/aes.md +++ /dev/null @@ -1,93 +0,0 @@ ---- -{ -"title": "AES", -"language": "zh-CN" -} ---- - - - -# AES_ENCRYPT - -## description -Aes 加密函数 -### Syntax - -`VARCHAR AES_ENCRYPT(str,key_str[,init_vector])` - -返回加密后的结果 - -## example - -``` -MySQL > select to_base64(AES_ENCRYPT('text','F3229A0B371ED2D9441B830D21A390C3')); -+--------------------------------+ -| to_base64(aes_encrypt('text')) | -+--------------------------------+ -| wr2JEDVXzL9+2XtRhgIloA== | -+--------------------------------+ -1 row in set (0.010 sec) - -MySQL> set block_encryption_mode="AES_256_CBC"; -Query OK, 0 rows affected (0.006 sec) - -MySQL > select to_base64(AES_ENCRYPT('text','F3229A0B371ED2D9441B830D21A390C3', '0123456789')); -+----------------------------------------------------------------------------------+ -| to_base64(aes_encrypt('text', 'F3229A0B371ED2D9441B830D21A390C3', '0123456789')) | -+----------------------------------------------------------------------------------+ -| mvZT1KJw7N0RJf27aipUpg== | -+----------------------------------------------------------------------------------+ -1 row in set (0.011 sec) -``` - -# AES_DECRYPT - -## description -Aes 解密函数 -### Syntax - -`VARCHAR AES_DECRYPT(str,key_str[,init_vector])` - -返回解密后的结果 - -## example - -``` -MySQL > select AES_DECRYPT(FROM_BASE64('wr2JEDVXzL9+2XtRhgIloA=='),'F3229A0B371ED2D9441B830D21A390C3'); -+------------------------------------------------------+ -| aes_decrypt(from_base64('wr2JEDVXzL9+2XtRhgIloA==')) | -+------------------------------------------------------+ -| text | -+------------------------------------------------------+ -1 row in set (0.012 sec) - -MySQL> set block_encryption_mode="AES_256_CBC"; -Query OK, 0 rows affected (0.006 sec) - -MySQL > select AES_DECRYPT(FROM_BASE64('mvZT1KJw7N0RJf27aipUpg=='),'F3229A0B371ED2D9441B830D21A390C3', '0123456789'); -+--------------------------------------------------------------------------------------------------------+ -| aes_decrypt(from_base64('mvZT1KJw7N0RJf27aipUpg=='), 'F3229A0B371ED2D9441B830D21A390C3', '0123456789') | -+--------------------------------------------------------------------------------------------------------+ -| text | -+--------------------------------------------------------------------------------------------------------+ -1 row in set (0.012 sec) -``` - -## keyword - - AES_ENCRYPT, AES_DECRYPT \ No newline at end of file diff --git a/docs/zh-CN/sql-manual/sql-functions/encrypt-dixgest-functions/md5.md b/docs/zh-CN/sql-manual/sql-functions/encrypt-dixgest-functions/md5.md deleted file mode 100644 index 38da45be42e29e..00000000000000 --- a/docs/zh-CN/sql-manual/sql-functions/encrypt-dixgest-functions/md5.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -{ -"title": "MD5", -"language": "zh-CN" -} ---- - - - -# MD5 - -## description -计算 MD5 128-bit -### Syntax - -`MD5(str)` - -## example - -``` -MySQL [(none)]> select md5("abc"); -+----------------------------------+ -| md5('abc') | -+----------------------------------+ -| 900150983cd24fb0d6963f7d28e17f72 | -+----------------------------------+ -1 row in set (0.013 sec) -``` - -## keyword - - MD5 \ No newline at end of file diff --git a/docs/zh-CN/sql-manual/sql-functions/encrypt-dixgest-functions/md5sum.md b/docs/zh-CN/sql-manual/sql-functions/encrypt-dixgest-functions/md5sum.md deleted file mode 100644 index 9374fc46a0e5a8..00000000000000 --- a/docs/zh-CN/sql-manual/sql-functions/encrypt-dixgest-functions/md5sum.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -{ -"title": "MD5SUM", -"language": "zh-CN" -} ---- - - - -# MD5SUM - -## description -计算 多个字符串 MD5 128-bit -### Syntax - -`MD5SUM(str[,str])` - -## example - -``` -MySQL > select md5("abcd"); -+----------------------------------+ -| md5('abcd') | -+----------------------------------+ -| e2fc714c4727ee9395f324cd2e7f331f | -+----------------------------------+ -1 row in set (0.011 sec) - -MySQL > select md5sum("ab","cd"); -+----------------------------------+ -| md5sum('ab', 'cd') | -+----------------------------------+ -| e2fc714c4727ee9395f324cd2e7f331f | -+----------------------------------+ -1 row in set (0.008 sec) - -``` - -## keyword - - MD5SUM \ No newline at end of file diff --git a/docs/zh-CN/sql-manual/sql-functions/encrypt-dixgest-functions/sm3.md b/docs/zh-CN/sql-manual/sql-functions/encrypt-dixgest-functions/sm3.md deleted file mode 100644 index f0efd68f385e98..00000000000000 --- a/docs/zh-CN/sql-manual/sql-functions/encrypt-dixgest-functions/sm3.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -{ -"title": "SM3", -"language": "zh-CN" -} ---- - - - -# SM3 - -## description -计算 SM3 256-bit -### Syntax - -`SM3(str)` - -## example - -``` -MySQL > select sm3("abcd"); -+------------------------------------------------------------------+ -| sm3('abcd') | -+------------------------------------------------------------------+ -| 82ec580fe6d36ae4f81cae3c73f4a5b3b5a09c943172dc9053c69fd8e18dca1e | -+------------------------------------------------------------------+ -1 row in set (0.009 sec) -``` - -## keyword - - SM3 \ No newline at end of file diff --git a/docs/zh-CN/sql-manual/sql-functions/encrypt-dixgest-functions/sm3sum.md b/docs/zh-CN/sql-manual/sql-functions/encrypt-dixgest-functions/sm3sum.md deleted file mode 100644 index 5f0f9712dade83..00000000000000 --- a/docs/zh-CN/sql-manual/sql-functions/encrypt-dixgest-functions/sm3sum.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -{ -"title": "SM3SUM", -"language": "zh-CN" -} ---- - - - -# SM3SUM - -## description -计算 多个字符串 SM3 256-bit -### Syntax - -`SM3SUM(str[,str])` - -## example - -``` -MySQL > select sm3("abcd"); -+------------------------------------------------------------------+ -| sm3('abcd') | -+------------------------------------------------------------------+ -| 82ec580fe6d36ae4f81cae3c73f4a5b3b5a09c943172dc9053c69fd8e18dca1e | -+------------------------------------------------------------------+ -1 row in set (0.009 sec) - -MySQL > select sm3sum("ab","cd"); -+------------------------------------------------------------------+ -| sm3sum('ab', 'cd') | -+------------------------------------------------------------------+ -| 82ec580fe6d36ae4f81cae3c73f4a5b3b5a09c943172dc9053c69fd8e18dca1e | -+------------------------------------------------------------------+ -1 row in set (0.009 sec) - -``` - -## keyword - - SM3SUM \ No newline at end of file diff --git a/docs/zh-CN/sql-manual/sql-functions/encrypt-dixgest-functions/sm4.md b/docs/zh-CN/sql-manual/sql-functions/encrypt-dixgest-functions/sm4.md deleted file mode 100644 index 35b6575fe4d4e1..00000000000000 --- a/docs/zh-CN/sql-manual/sql-functions/encrypt-dixgest-functions/sm4.md +++ /dev/null @@ -1,93 +0,0 @@ ---- -{ -"title": "SM4", -"language": "zh-CN" -} ---- - - - -# SM4_ENCRYPT - -## description -SM4 加密函数 -### Syntax - -`VARCHAR SM4_ENCRYPT(str,key_str[,init_vector])` - -返回加密后的结果 - -## example - -``` -MySQL > select TO_BASE64(SM4_ENCRYPT('text','F3229A0B371ED2D9441B830D21A390C3')); -+--------------------------------+ -| to_base64(sm4_encrypt('text')) | -+--------------------------------+ -| aDjwRflBrDjhBZIOFNw3Tg== | -+--------------------------------+ -1 row in set (0.010 sec) - -MySQL > set block_encryption_mode="SM4_128_CBC"; -Query OK, 0 rows affected (0.001 sec) - -MySQL > select to_base64(SM4_ENCRYPT('text','F3229A0B371ED2D9441B830D21A390C3', '0123456789')); -+----------------------------------------------------------------------------------+ -| to_base64(sm4_encrypt('text', 'F3229A0B371ED2D9441B830D21A390C3', '0123456789')) | -+----------------------------------------------------------------------------------+ -| G7yqOKfEyxdagboz6Qf01A== | -+----------------------------------------------------------------------------------+ -1 row in set (0.014 sec) -``` - -# SM4_DECRYPT - -## description -Aes 解密函数 -### Syntax - -`VARCHAR AES_DECRYPT(str,key_str[,init_vector])` - -返回解密后的结果 - -## example - -``` -MySQL [(none)]> select SM4_DECRYPT(FROM_BASE64('aDjwRflBrDjhBZIOFNw3Tg=='),'F3229A0B371ED2D9441B830D21A390C3'); -+------------------------------------------------------+ -| sm4_decrypt(from_base64('aDjwRflBrDjhBZIOFNw3Tg==')) | -+------------------------------------------------------+ -| text | -+------------------------------------------------------+ -1 row in set (0.009 sec) - -MySQL> set block_encryption_mode="SM4_128_CBC"; -Query OK, 0 rows affected (0.006 sec) - -MySQL > select SM4_DECRYPT(FROM_BASE64('G7yqOKfEyxdagboz6Qf01A=='),'F3229A0B371ED2D9441B830D21A390C3', '0123456789'); -+--------------------------------------------------------------------------------------------------------+ -| sm4_decrypt(from_base64('G7yqOKfEyxdagboz6Qf01A=='), 'F3229A0B371ED2D9441B830D21A390C3', '0123456789') | -+--------------------------------------------------------------------------------------------------------+ -| text | -+--------------------------------------------------------------------------------------------------------+ -1 row in set (0.012 sec) -``` - -## keyword - - SM4_ENCRYPT, SM4_DECRYPT \ No newline at end of file diff --git a/docs/zh-CN/sql-manual/sql-functions/hash-functions/murmur_hash3_32.md b/docs/zh-CN/sql-manual/sql-functions/hash-functions/murmur_hash3_32.md index f1f237255a0544..dc37f176d84b36 100644 --- a/docs/zh-CN/sql-manual/sql-functions/hash-functions/murmur_hash3_32.md +++ b/docs/zh-CN/sql-manual/sql-functions/hash-functions/murmur_hash3_32.md @@ -22,16 +22,16 @@ specific language governing permissions and limitations under the License. --> -# murmur_hash3_32 +## murmur_hash3_32 -## description -### Syntax +### description +#### Syntax `INT MURMUR_HASH3_32(VARCHAR input, ...)` 返回输入字符串的32位murmur3 hash值 -## example +### example ``` mysql> select murmur_hash3_32(null); @@ -56,6 +56,6 @@ mysql> select murmur_hash3_32("hello", "world"); +-----------------------------------+ ``` -## keyword +### keywords MURMUR_HASH3_32,HASH diff --git a/docs/zh-CN/sql-manual/sql-functions/json-functions/get_json_double.md b/docs/zh-CN/sql-manual/sql-functions/json-functions/get_json_double.md index 782bdc8eba4797..057fc730913420 100644 --- a/docs/zh-CN/sql-manual/sql-functions/json-functions/get_json_double.md +++ b/docs/zh-CN/sql-manual/sql-functions/json-functions/get_json_double.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# get_json_double -## description -### Syntax +## get_json_double +### description +#### Syntax `DOUBLE get_json_double(VARCHAR json_str, VARCHAR json_path)` @@ -37,7 +37,7 @@ under the License. path 的内容不能包含 ", [ 和 ]。 如果 json_string 格式不对,或 json_path 格式不对,或无法找到匹配项,则返回 NULL。 -## example +### example 1. 获取 key 为 "k1" 的 value @@ -70,5 +70,5 @@ mysql> SELECT get_json_double('{"k1.key":{"k2":[1.1, 2.2]}}', '$."k1.key".k2[0]' | 1.1 | +---------------------------------------------------------------------+ ``` -## keyword +### keywords GET_JSON_DOUBLE,GET,JSON,DOUBLE diff --git a/docs/zh-CN/sql-manual/sql-functions/json-functions/get_json_int.md b/docs/zh-CN/sql-manual/sql-functions/json-functions/get_json_int.md index 7b1ac67a441e8b..5135e1b855eb1c 100644 --- a/docs/zh-CN/sql-manual/sql-functions/json-functions/get_json_int.md +++ b/docs/zh-CN/sql-manual/sql-functions/json-functions/get_json_int.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# get_json_int -## description -### Syntax +## get_json_int +### description +#### Syntax `INT get_json_int(VARCHAR json_str, VARCHAR json_path)` @@ -37,7 +37,7 @@ under the License. path 的内容不能包含 ", [ 和 ]。 如果 json_string 格式不对,或 json_path 格式不对,或无法找到匹配项,则返回 NULL。 -## example +### example 1. 获取 key 为 "k1" 的 value @@ -70,5 +70,5 @@ mysql> SELECT get_json_int('{"k1.key":{"k2":[1, 2]}}', '$."k1.key".k2[0]'); | 1 | +--------------------------------------------------------------+ ``` -## keyword +### keywords GET_JSON_INT,GET,JSON,INT diff --git a/docs/zh-CN/sql-manual/sql-functions/json-functions/get_json_string.md b/docs/zh-CN/sql-manual/sql-functions/json-functions/get_json_string.md index 9311a77ea77564..ce022fabb58039 100644 --- a/docs/zh-CN/sql-manual/sql-functions/json-functions/get_json_string.md +++ b/docs/zh-CN/sql-manual/sql-functions/json-functions/get_json_string.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# get_json_string -## description -### Syntax +## get_json_string +### description +#### Syntax `VARCHAR get_json_string(VARCHAR json_str, VARCHAR json_path)` @@ -37,7 +37,7 @@ under the License. path 的内容不能包含 ", [ 和 ]。 如果 json_string 格式不对,或 json_path 格式不对,或无法找到匹配项,则返回 NULL。 -## example +### example 1. 获取 key 为 "k1" 的 value @@ -80,5 +80,5 @@ mysql> SELECT get_json_string('[{"k1":"v1"}, {"k2":"v2"}, {"k1":"v3"}, {"k1":"v4 | ["v1","v3","v4"] | +---------------------------------------------------------------------------------+ ``` -## keyword +### keywords GET_JSON_STRING,GET,JSON,STRING diff --git a/docs/zh-CN/sql-manual/sql-functions/json-functions/json_array.md b/docs/zh-CN/sql-manual/sql-functions/json-functions/json_array.md index ff6a622cf36733..e7cae77fdaab15 100644 --- a/docs/zh-CN/sql-manual/sql-functions/json-functions/json_array.md +++ b/docs/zh-CN/sql-manual/sql-functions/json-functions/json_array.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# json_array -## description -### Syntax +## json_array +### description +#### Syntax `VARCHAR json_array(VARCHAR,...)` 生成一个包含指定元素的json数组,未指定时返回空数组 -## example +### example ``` MySQL> select json_array(); @@ -66,5 +66,5 @@ MySQL> select json_array("a", null, "c"); | ["a", NULL, "c"] | +------------------------------+ ``` -## keyword +### keywords json_array diff --git a/docs/zh-CN/sql-manual/sql-functions/json-functions/json_object.md b/docs/zh-CN/sql-manual/sql-functions/json-functions/json_object.md index 0f3b1fe8a6746e..3765518754bbcb 100644 --- a/docs/zh-CN/sql-manual/sql-functions/json-functions/json_object.md +++ b/docs/zh-CN/sql-manual/sql-functions/json-functions/json_object.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# json_object -## description -### Syntax +## json_object +### description +#### Syntax `VARCHAR json_object(VARCHAR,...)` 生成一个包含指定Key-Value对的json object, 当Key值为NULL或者传入参数为奇数个时,返回异常错误 -## example +### example ``` MySQL> select json_object(); @@ -66,5 +66,5 @@ MySQL> select json_object('username',null); | {"username": NULL} | +---------------------------------+ ``` -## keyword +### keywords json_object diff --git a/docs/zh-CN/sql-manual/sql-functions/json-functions/json_quote.md b/docs/zh-CN/sql-manual/sql-functions/json-functions/json_quote.md index 67ed605b60e074..36ccf115c83fd7 100644 --- a/docs/zh-CN/sql-manual/sql-functions/json-functions/json_quote.md +++ b/docs/zh-CN/sql-manual/sql-functions/json-functions/json_quote.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# json_quote -## description -### Syntax +## json_quote +### description +#### Syntax `VARCHAR json_quote(VARCHAR)` 将json_value用双引号(")括起来,跳过其中包含的特殊转义字符 -## example +### example ``` MySQL> SELECT json_quote('null'), json_quote('"null"'); @@ -66,5 +66,5 @@ MySQL> select json_quote("\n\b\r\t"); | "\n\b\r\t" | +------------------------+ ``` -## keyword +### keywords json_quote diff --git a/docs/zh-CN/sql-manual/sql-functions/math-functions/conv.md b/docs/zh-CN/sql-manual/sql-functions/math-functions/conv.md index 280228ec8973bd..3f5f1b13acbdc0 100644 --- a/docs/zh-CN/sql-manual/sql-functions/math-functions/conv.md +++ b/docs/zh-CN/sql-manual/sql-functions/math-functions/conv.md @@ -22,16 +22,16 @@ specific language governing permissions and limitations under the License. --> -# conv +## conv -## description -### Syntax +### description +#### Syntax `VARCHAR CONV(VARCHAR input, TINYINT from_base, TINYINT to_base)` `VARCHAR CONV(BIGINT input, TINYINT from_base, TINYINT to_base)` 对输入的数字进行进制转换,输入的进制范围应该在`[2,36]`以内。 -## example +### example ``` MySQL [test]> SELECT CONV(15,10,2); @@ -56,5 +56,5 @@ MySQL [test]> SELECT CONV(230,10,16); +-------------------+ ``` -## keyword +### keywords CONV diff --git a/docs/zh-CN/sql-manual/sql-functions/math-functions/pmod.md b/docs/zh-CN/sql-manual/sql-functions/math-functions/pmod.md index d97968b9562672..88552ddcf39f59 100644 --- a/docs/zh-CN/sql-manual/sql-functions/math-functions/pmod.md +++ b/docs/zh-CN/sql-manual/sql-functions/math-functions/pmod.md @@ -22,17 +22,17 @@ specific language governing permissions and limitations under the License. --> -# pmod +## pmod -## description -### Syntax +### description +#### Syntax `BIGINT PMOD(BIGINT x, BIGINT y)` `DOUBLE PMOD(DOUBLE x, DOUBLE y)` 返回在模系下`x mod y`的最小正数解. 具体地来说, 返回 `(x%y+y)%y`. -## example +### example ``` MySQL [test]> SELECT PMOD(13,5); @@ -49,5 +49,5 @@ MySQL [test]> SELECT PMOD(-13,5); +-------------+ ``` -## keyword +### keywords PMOD diff --git a/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_astext.md b/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_astext.md index 1b187507af8ce3..cf65a37650e862 100644 --- a/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_astext.md +++ b/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_astext.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# `ST_AsText`,`ST_AsWKT` -## description -### Syntax +## `ST_AsText`,`ST_AsWKT` +### description +#### Syntax `VARCHAR ST_AsText(GEOMETRY geo)` 将一个几何图形转化为WKT(Well Known Text)的表示形式 -## example +### example ``` mysql> SELECT ST_AsText(ST_Point(24.7, 56.7)); @@ -43,5 +43,5 @@ mysql> SELECT ST_AsText(ST_Point(24.7, 56.7)); | POINT (24.7 56.7) | +---------------------------------+ ``` -## keyword +### keywords ST_ASTEXT,ST_ASWKT,ST,ASTEXT,ASWKT diff --git a/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_circle.md b/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_circle.md index 8c8ac1efb8a6ba..6d6a752c135fbb 100644 --- a/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_circle.md +++ b/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_circle.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# `ST_Circle` -## description -### Syntax +## `ST_Circle` +### description +#### Syntax `GEOMETRY ST_Circle(DOUBLE center_lng, DOUBLE center_lat, DOUBLE radius)` @@ -34,7 +34,7 @@ under the License. 将一个WKT(Well Known Text)转化为地球球面上的一个圆。其中`center_lng`表示的圆心的经度, `center_lat`表示的是圆心的纬度,`radius`表示的是圆的半径,单位是米,最大支持9999999 -## example +### example ``` mysql> SELECT ST_AsText(ST_Circle(111, 64, 10000)); @@ -44,5 +44,5 @@ mysql> SELECT ST_AsText(ST_Circle(111, 64, 10000)); | CIRCLE ((111 64), 10000) | +--------------------------------------------+ ``` -## keyword +### keywords ST_CIRCLE,ST,CIRCLE diff --git a/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_contains.md b/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_contains.md index 393cb9a6b13c8f..db539bf0f5a239 100644 --- a/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_contains.md +++ b/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_contains.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# `ST_Contains` -## description -### Syntax +## `ST_Contains` +### description +#### Syntax `BOOL ST_Contains(GEOMETRY shape1, GEOMETRY shape2)` 判断几何图形shape1是否完全能够包含几何图形shape2 -## example +### example ``` mysql> SELECT ST_Contains(ST_Polygon("POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))"), ST_Point(5, 5)); @@ -50,5 +50,5 @@ mysql> SELECT ST_Contains(ST_Polygon("POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))"), | 0 | +------------------------------------------------------------------------------------------+ ``` -## keyword +### keywords ST_CONTAINS,ST,CONTAINS diff --git a/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_distance_sphere.md b/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_distance_sphere.md index a55072982e7e8e..f75f2a130ae174 100644 --- a/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_distance_sphere.md +++ b/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_distance_sphere.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# `ST_Distance_Sphere` -## description -### Syntax +## `ST_Distance_Sphere` +### description +#### Syntax `DOUBLE ST_Distance_Sphere(DOUBLE x_lng, DOUBLE x_lat, DOUBLE y_lng, DOUBLE x_lat)` 计算地球两点之间的球面距离,单位为 米。传入的参数分别为X点的经度,X点的纬度,Y点的经度,Y点的纬度。 -## example +### example ``` mysql> select st_distance_sphere(116.35620117, 39.939093, 116.4274406433, 39.9020987219); @@ -43,5 +43,5 @@ mysql> select st_distance_sphere(116.35620117, 39.939093, 116.4274406433, 39.902 | 7336.9135549995917 | +----------------------------------------------------------------------------+ ``` -## keyword +### keywords ST_DISTANCE_SPHERE,ST,DISTANCE,SPHERE diff --git a/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_geometryfromtext.md b/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_geometryfromtext.md index 802ca72af1d998..169ce008aa2a98 100644 --- a/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_geometryfromtext.md +++ b/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_geometryfromtext.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# `ST_GeometryFromText`,`ST_GeomFromText` -## description -### Syntax +## `ST_GeometryFromText`,`ST_GeomFromText` +### description +#### Syntax `GEOMETRY ST_GeometryFromText(VARCHAR wkt)` 将一个WKT(Well Known Text)转化为对应的内存的几何形式 -## example +### example ``` mysql> SELECT ST_AsText(ST_GeometryFromText("LINESTRING (1 1, 2 2)")); @@ -43,5 +43,5 @@ mysql> SELECT ST_AsText(ST_GeometryFromText("LINESTRING (1 1, 2 2)")); | LINESTRING (1 1, 2 2) | +---------------------------------------------------------+ ``` -## keyword +### keywords ST_GEOMETRYFROMTEXT,ST_GEOMFROMTEXT,ST,GEOMETRYFROMTEXT,GEOMFROMTEXT diff --git a/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_linefromtext.md b/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_linefromtext.md index a135f14e5f39bc..e1cdce8211f79c 100644 --- a/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_linefromtext.md +++ b/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_linefromtext.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# `ST_LineFromText`,`ST_LineStringFromText` -## description -### Syntax +## `ST_LineFromText`,`ST_LineStringFromText` +### description +#### Syntax `GEOMETRY ST_LineFromText(VARCHAR wkt)` 将一个WKT(Well Known Text)转化为一个Line形式的内存表现形式 -## example +### example ``` mysql> SELECT ST_AsText(ST_LineFromText("LINESTRING (1 1, 2 2)")); @@ -43,5 +43,5 @@ mysql> SELECT ST_AsText(ST_LineFromText("LINESTRING (1 1, 2 2)")); | LINESTRING (1 1, 2 2) | +---------------------------------------------------------+ ``` -## keyword +### keywords ST_LINEFROMTEXT,ST_LINESTRINGFROMTEXT,ST,LINEFROMTEXT,LINESTRINGFROMTEXT diff --git a/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_point.md b/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_point.md index 3aa9efb1fb0189..79ad6c599de620 100644 --- a/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_point.md +++ b/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_point.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# `ST_Point` -## description -### Syntax +## `ST_Point` +### description +#### Syntax `POINT ST_Point(DOUBLE x, DOUBLE y)` @@ -34,7 +34,7 @@ under the License. 通过给定的X坐标值,Y坐标值返回对应的Point。 当前这个值只是在球面集合上有意义,X/Y对应的是经度/纬度(longitude/latitude);ps:直接select ST_Point()会卡主,慎重!!! -## example +### example ``` mysql> SELECT ST_AsText(ST_Point(24.7, 56.7)); @@ -44,5 +44,5 @@ mysql> SELECT ST_AsText(ST_Point(24.7, 56.7)); | POINT (24.7 56.7) | +---------------------------------+ ``` -## keyword +### keywords ST_POINT,ST,POINT diff --git a/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_polygon.md b/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_polygon.md index eb6ab99a751874..4178480986ca89 100644 --- a/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_polygon.md +++ b/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_polygon.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# `ST_Polygon`,`ST_PolyFromText`,`ST_PolygonFromText` -## description -### Syntax +## `ST_Polygon`,`ST_PolyFromText`,`ST_PolygonFromText` +### description +#### Syntax `GEOMETRY ST_Polygon(VARCHAR wkt)` 将一个WKT(Well Known Text)转化为对应的多边形内存形式 -## example +### example ``` mysql> SELECT ST_AsText(ST_Polygon("POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))")); @@ -43,5 +43,5 @@ mysql> SELECT ST_AsText(ST_Polygon("POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))")); | POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0)) | +------------------------------------------------------------------+ ``` -## keyword +### keywords ST_POLYGON,ST_POLYFROMTEXT,ST_POLYGONFROMTEXT,ST,POLYGON,POLYFROMTEXT,POLYGONFROMTEXT diff --git a/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_x.md b/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_x.md index 971085f2706a74..b3c63992b6f7c1 100644 --- a/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_x.md +++ b/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_x.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# `ST_X` -## description -### Syntax +## `ST_X` +### description +#### Syntax `DOUBLE ST_X(POINT point)` 当point是一个合法的POINT类型时,返回对应的X坐标值 -## example +### example ``` mysql> SELECT ST_X(ST_Point(24.7, 56.7)); @@ -43,5 +43,5 @@ mysql> SELECT ST_X(ST_Point(24.7, 56.7)); | 24.7 | +----------------------------+ ``` -## keyword +### keywords ST_X,ST,X diff --git a/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_y.md b/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_y.md index fda4b4777d017b..ab4b2b15f969f6 100644 --- a/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_y.md +++ b/docs/zh-CN/sql-manual/sql-functions/spatial-functions/st_y.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# `ST_Y` -## description -### Syntax +## `ST_Y` +### description +#### Syntax `DOUBLE ST_Y(POINT point)` 当point是一个合法的POINT类型时,返回对应的Y坐标值 -## example +### example ``` mysql> SELECT ST_Y(ST_Point(24.7, 56.7)); @@ -43,5 +43,5 @@ mysql> SELECT ST_Y(ST_Point(24.7, 56.7)); | 56.7 | +----------------------------+ ``` -## keyword +### keywords ST_Y,ST,Y diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/append_trailing_char_if_absent.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/append_trailing_char_if_absent.md index 3250d00c9f30d0..43ca0c12c0b149 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/append_trailing_char_if_absent.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/append_trailing_char_if_absent.md @@ -24,18 +24,18 @@ specific language governing permissions and limitations under the License. --> -# append_trailing_char_if_absent +## append_trailing_char_if_absent -## description +### description -### Syntax +#### Syntax `VARCHAR append_trailing_char_if_absent(VARCHAR str, VARCHAR trailing_char)` 如果 str 字符串非空并且末尾不包含 trailing_char 字符,则将 trailing_char 字符附加到末尾。 trailing_char 只能包含一个字符,如果包含多个字符,将返回NULL -## example +### example ``` MySQL [test]> select append_trailing_char_if_absent('a','c'); @@ -55,6 +55,6 @@ MySQL [test]> select append_trailing_char_if_absent('ac','c'); 1 row in set (0.00 sec) ``` -## keyword +### keywords APPEND_TRAILING_CHAR_IF_ABSENT diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/ascii.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/ascii.md index 73f2dc8bd0e9f2..cef492b75cb133 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/ascii.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/ascii.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# ascii -## description -### Syntax +## ascii +### description +#### Syntax `INT ascii(VARCHAR str)` 返回字符串第一个字符对应的 ascii 码 -## example +### example ``` mysql> select ascii('1'); @@ -50,5 +50,5 @@ mysql> select ascii('234'); | 50 | +--------------+ ``` -## keyword +### keywords ASCII diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/bit_length.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/bit_length.md index be76317f38b07b..ce294cfcbf5146 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/bit_length.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/bit_length.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# bit_length -## description -### Syntax +## bit_length +### description +#### Syntax `INT bit_length(VARCHAR str)` 返回字符串的位长度。 -## example +### example ``` mysql> select bit_length("abc"); @@ -50,5 +50,5 @@ mysql> select bit_length("中国"); | 48 | +----------------------+ ``` -## keyword +### keywords BIT_LENGTH diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/char_length.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/char_length.md index b74498b27df18e..f0ee2ff17e546a 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/char_length.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/char_length.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# char_length -## description -### Syntax +## char_length +### description +#### Syntax `INT char_length(VARCHAR str)` 返回字符串的长度,对于多字节字符,返回字符数, 目前仅支持utf8 编码。这个函数还有一个别名 `character_length`。 -## example +### example ``` mysql> select char_length("abc"); @@ -50,5 +50,5 @@ mysql> select char_length("中国"); | 2 | +-----------------------+ ``` -## keyword +### keywords CHAR_LENGTH, CHARACTER_LENGTH diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/concat.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/concat.md index 460a5309c30dd6..01bd503fd533bc 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/concat.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/concat.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# concat -## description -### Syntax +## concat +### description +#### Syntax `VARCHAR concat(VARCHAR,...)` 将多个字符串连接起来, 如果参数中任意一个值是 NULL,那么返回的结果就是 NULL -## example +### example ``` mysql> select concat("a", "b"); @@ -57,5 +57,5 @@ mysql> select concat("a", null, "c"); | NULL | +------------------------+ ``` -## keyword +### keywords CONCAT diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/concat_ws.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/concat_ws.md index 7710ec7cd9e1d4..bcebf9f4a60959 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/concat_ws.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/concat_ws.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# concat_ws -## description -### Syntax +## concat_ws +### description +#### Syntax `VARCHAR concat_ws(VARCHAR sep, VARCHAR str,...)` @@ -35,7 +35,7 @@ under the License. 如果分隔符是 NULL,返回 NULL。 `concat_ws`函数不会跳过空字符串,会跳过 NULL 值 -## example +### example ``` mysql> select concat_ws("or", "d", "is"); @@ -59,5 +59,5 @@ mysql> select concat_ws("or", "d", NULL,"is"); | doris | +---------------------------------+ ``` -## keyword +### keywords CONCAT_WS,CONCAT,WS diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/ends_with.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/ends_with.md index d839e0e1620b2a..a65463138486a0 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/ends_with.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/ends_with.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# ends_with -## description -### Syntax +## ends_with +### description +#### Syntax `BOOLEAN ENDS_WITH (VARCHAR str, VARCHAR suffix)` 如果字符串以指定后缀结尾,返回true。否则,返回false。任意参数为NULL,返回NULL。 -## example +### example ``` mysql> select ends_with("Hello doris", "doris"); @@ -49,5 +49,5 @@ mysql> select ends_with("Hello doris", "Hello"); | 0 | +-----------------------------------+ ``` -## keyword +### keywords ENDS_WITH diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/find_in_set.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/find_in_set.md index 1b231565484413..25fa21d4d3d85d 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/find_in_set.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/find_in_set.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# find_in_set -## description -### Syntax +## find_in_set +### description +#### Syntax `INT find_in_set(VARCHAR str, VARCHAR strlist)` 返回 strlist 中第一次出现 str 的位置(从1开始计数)。strlist 是用逗号分隔的字符串。如果没有找到,返回0。任意参数为 NULL ,返回 NULL。 -## example +### example ``` mysql> select find_in_set("b", "a,b,c"); @@ -43,5 +43,5 @@ mysql> select find_in_set("b", "a,b,c"); | 2 | +---------------------------+ ``` -## keyword +### keywords FIND_IN_SET,FIND,IN,SET diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/hex.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/hex.md index 51d861f9869147..6d2893789e855d 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/hex.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/hex.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# hex -## description -### Syntax +## hex +### description +#### Syntax `VARCHAR hex(VARCHAR str)` @@ -37,7 +37,7 @@ under the License. 如果输入参数是字符串,则将每个字符转化为两个十六进制的字符,将转化后的所有字符拼接为字符串输出 -## example +### example ``` 输入字符串 @@ -81,5 +81,5 @@ mysql> select hex(-1); | FFFFFFFFFFFFFFFF | +------------------+ ``` -## keyword +### keywords HEX diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/instr.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/instr.md index c720b27b1b9a15..2aa8936858a4e3 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/instr.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/instr.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# instr -## description -### Syntax +## instr +### description +#### Syntax `INT instr(VARCHAR str, VARCHAR substr)` 返回 substr 在 str 中第一次出现的位置(从1开始计数)。如果 substr 不在 str 中出现,则返回0。 -## example +### example ``` mysql> select instr("abc", "b"); @@ -50,5 +50,5 @@ mysql> select instr("abc", "d"); | 0 | +-------------------+ ``` -## keyword +### keywords INSTR diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/lcase.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/lcase.md index d801c5c054b7a3..7edd3cc1c5fe8d 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/lcase.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/lcase.md @@ -24,14 +24,14 @@ specific language governing permissions and limitations under the License. --> -# lcase -## description -### Syntax +## lcase +### description +#### Syntax `INT lcase(VARCHAR str)` 与`lower`一致 -## keyword +### keywords LCASE diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/left.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/left.md index 3471f2778d50b9..1cf513192336e2 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/left.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/left.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# left -## description -### Syntax +## left +### description +#### Syntax `VARCHAR left(VARCHAR str)` 它返回具有指定长度的字符串的左边部分, 长度的单位为utf8字符 -## example +### example ``` mysql> select left("Hello doris",5); @@ -43,5 +43,5 @@ mysql> select left("Hello doris",5); | Hello | +------------------------+ ``` -## keyword +### keywords LEFT diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/length.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/length.md index d0a5e279876def..b83373811d5b3c 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/length.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/length.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# length -## description -### Syntax +## length +### description +#### Syntax `INT length(VARCHAR str)` 返回字符串的字节。 -## example +### example ``` mysql> select length("abc"); @@ -50,5 +50,5 @@ mysql> select length("中国"); | 6 | +------------------+ ``` -## keyword +### keywords LENGTH diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/like/like.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/like/like.md index 710cdf4df2dbbb..223fd220739b9f 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/like/like.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/like/like.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# like -## description -### syntax +## like +### description +#### syntax `BOOLEAN like(VARCHAR str, VARCHAR pattern)` @@ -48,7 +48,7 @@ like 匹配/模糊匹配,会与 % 和 _ 结合使用。 'a_' // 两位且开头字符是 a的数据 'a__b' // 四位且以字符a开头、b结尾的数据 ``` -## example +### example ``` // table test @@ -79,5 +79,5 @@ mysql > select k1 from test where k1 like 'a'; +-------+ ``` -## keyword +### keywords LIKE diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/like/not_like.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/like/not_like.md index 776acab4753f97..7d6fba9ab0075b 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/like/not_like.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/like/not_like.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# not like -## description -### syntax +## not like +### description +#### syntax `BOOLEAN not like(VARCHAR str, VARCHAR pattern)` @@ -48,7 +48,7 @@ like 匹配/模糊匹配,会与 % 和 _ 结合使用。 'a_' // 两位且开头字母是 a 的数据 'a__b' // 四位且以字符a开头、b结尾的数据 ``` -## example +### example ``` // table test @@ -81,5 +81,5 @@ mysql > select k1 from test where k1 not like 'a'; +-------+ ``` -## keyword +### keywords LIKE, NOT, NOT LIKE diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/locate.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/locate.md index c3d064835d1991..aa0adf2146b194 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/locate.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/locate.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# locate -## description -### Syntax +## locate +### description +#### Syntax `INT locate(VARCHAR substr, VARCHAR str[, INT pos])` 返回 substr 在 str 中出现的位置(从1开始计数)。如果指定第3个参数 pos,则从 str 以 pos 下标开始的字符串处开始查找 substr 出现的位置。如果没有找到,返回0 -## example +### example ``` mysql> SELECT LOCATE('bar', 'foobarbar'); @@ -57,5 +57,5 @@ mysql> SELECT LOCATE('bar', 'foobarbar', 5); | 7 | +-------------------------------+ ``` -## keyword +### keywords LOCATE diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/lower.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/lower.md index 8bede875f80570..5d6d0da4f6575d 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/lower.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/lower.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# lower -## description -### Syntax +## lower +### description +#### Syntax `INT lower(VARCHAR str)` 将参数中所有的字符串都转换成小写 -## example +### example ``` mysql> SELECT lower("AbC123"); @@ -43,5 +43,5 @@ mysql> SELECT lower("AbC123"); | abc123 | +-----------------+ ``` -## keyword +### keywords LOWER diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/lpad.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/lpad.md index f5363350f50bd3..d94f44082e6a03 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/lpad.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/lpad.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# lpad -## description -### Syntax +## lpad +### description +#### Syntax `VARCHAR lpad(VARCHAR str, INT len, VARCHAR pad)` 返回 str 中长度为 len(从首字母开始算起)的字符串。如果 len 大于 str 的长度,则在 str 的前面不断补充 pad 字符,直到该字符串的长度达到 len 为止。如果 len 小于 str 的长度,该函数相当于截断 str 字符串,只返回长度为 len 的字符串。len 指的是字符长度而不是字节长度。 -## example +### example ``` mysql> SELECT lpad("hi", 5, "xy"); @@ -50,5 +50,5 @@ mysql> SELECT lpad("hi", 1, "xy"); | h | +---------------------+ ``` -## keyword +### keywords LPAD diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/ltrim.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/ltrim.md index f8f37410b22e83..003756d829b29d 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/ltrim.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/ltrim.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# ltrim -## description -### Syntax +## ltrim +### description +#### Syntax `VARCHAR ltrim(VARCHAR str)` 将参数 str 中从开始部分连续出现的空格去掉 -## example +### example ``` mysql> SELECT ltrim(' ab d'); @@ -43,5 +43,5 @@ mysql> SELECT ltrim(' ab d'); | ab d | +------------------+ ``` -## keyword +### keywords LTRIM diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/money_format.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/money_format.md index cf5ab699de5017..d4faebd9344640 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/money_format.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/money_format.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# money_format -## description -### Syntax +## money_format +### description +#### Syntax `VARCHAR money_format(Number)` 将数字按照货币格式输出,整数部分每隔3位用逗号分隔,小数部分保留2位 -## example +### example ``` mysql> select money_format(17014116); @@ -57,5 +57,5 @@ mysql> select money_format(1123.4); | 1,123.40 | +----------------------+ ``` -## keyword +### keywords MONEY_FORMAT,MONEY,FORMAT diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/null_or_empty.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/null_or_empty.md index 6283d917cb1bb8..9f8ccd3ce5365f 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/null_or_empty.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/null_or_empty.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# null_or_empty -## description -### Syntax +## null_or_empty +### description +#### Syntax `BOOLEAN NULL_OR_EMPTY (VARCHAR str)` 如果字符串为空字符串或者NULL,返回true。否则,返回false。 -## example +### example ``` MySQL [(none)]> select null_or_empty(null); @@ -56,5 +56,5 @@ MySQL [(none)]> select null_or_empty("a"); | 0 | +--------------------+ ``` -## keyword -NULL_OR_EMPTY \ No newline at end of file +### keywords +NULL_OR_EMPTY diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/regexp/not_regexp.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/regexp/not_regexp.md index 270a7e559b6aff..5f07c927772e6b 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/regexp/not_regexp.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/regexp/not_regexp.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# not regexp -## description -### syntax +## not regexp +### description +#### syntax `BOOLEAN not regexp(VARCHAR str, VARCHAR pattern)` 对字符串 str 进行正则匹配,匹配上的则返回 false,没匹配上则返回 true。pattern 为正则表达式。 -## example +### example ``` // 查找 k1 字段中不以 'billie' 为开头的所有数据 @@ -52,5 +52,5 @@ mysql > select k1 from test where k1 not regexp 'ok$'; +------------+ ``` -## keyword +### keywords REGEXP, NOT, NOT REGEXP diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/regexp/regexp.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/regexp/regexp.md index fec12960a882cd..b42d7278d3a645 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/regexp/regexp.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/regexp/regexp.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# regexp -## description -### syntax +## regexp +### description +#### syntax `BOOLEAN regexp(VARCHAR str, VARCHAR pattern)` 对字符串 str 进行正则匹配,匹配上的则返回 true,没匹配上则返回 false。pattern 为正则表达式。 -## example +### example ``` // 查找 k1 字段中以 'billie' 为开头的所有数据 @@ -52,5 +52,5 @@ mysql > select k1 from test where k1 regexp 'ok$'; +----------+ ``` -## keyword +### keywords REGEXP diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/regexp/regexp_extract.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/regexp/regexp_extract.md index 737721a5a4b16b..f1fbaaf8822e7e 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/regexp/regexp_extract.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/regexp/regexp_extract.md @@ -22,16 +22,16 @@ specific language governing permissions and limitations under the License. --> -# regexp_extract -## description -### Syntax +## regexp_extract +### description +#### Syntax `VARCHAR regexp_extract(VARCHAR str, VARCHAR pattern, int pos)` 对字符串 str 进行正则匹配,抽取符合 pattern 的第 pos 个匹配部分。需要 pattern 完全匹配 str 中的某部分,这样才能返回 pattern 部分中需匹配部分。如果没有匹配,返回空字符串。 -## example +### example ``` mysql> SELECT regexp_extract('AbCdE', '([[:lower:]]+)C([[:lower:]]+)', 1); @@ -47,5 +47,5 @@ mysql> SELECT regexp_extract('AbCdE', '([[:lower:]]+)C([[:lower:]]+)', 2); | d | +-------------------------------------------------------------+ ``` -## keyword +### keywords REGEXP_EXTRACT,REGEXP,EXTRACT diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/regexp/regexp_replace.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/regexp/regexp_replace.md index 9540f09f1ca730..76e748cc4fda21 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/regexp/regexp_replace.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/regexp/regexp_replace.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# regexp_replace -## description -### Syntax +## regexp_replace +### description +#### Syntax `VARCHAR regexp_replace(VARCHAR str, VARCHAR pattern, VARCHAR repl)` 对字符串 str 进行正则匹配, 将命中 pattern 的部分使用 repl 来进行替换 -## example +### example ``` mysql> SELECT regexp_replace('a b c', " ", "-"); @@ -50,5 +50,5 @@ mysql> SELECT regexp_replace('a b c','(b)','<\\1>'); | a c | +----------------------------------------+ ``` -## keyword +### keywords REGEXP_REPLACE,REGEXP,REPLACE diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/repeat.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/repeat.md index 58ca8a8690aaf2..b4b8a579ec7019 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/repeat.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/repeat.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# repeat -## description -### Syntax +## repeat +### description +#### Syntax `VARCHAR repeat(VARCHAR str, INT count)` 将字符串 str 重复 count 次输出,count 小于1时返回空串,str,count 任一为NULL时,返回 NULL -## example +### example ``` mysql> SELECT repeat("a", 3); @@ -50,5 +50,5 @@ mysql> SELECT repeat("a", -1); | | +-----------------+ ``` -## keyword +### keywords REPEAT, diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/replace.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/replace.md index dda2625df07d90..9b317291b567c1 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/replace.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/replace.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# replace -## description -### Syntax +## replace +### description +#### Syntax `VARCHAR REPLACE (VARCHAR str, VARCHAR old, VARCHAR new)` 将str字符串中的old子串全部替换为new串 -## example +### example ``` mysql> select replace("http://www.baidu.com:9090", "9090", ""); @@ -42,5 +42,5 @@ mysql> select replace("http://www.baidu.com:9090", "9090", ""); | http://www.baidu.com: | +------------------------------------------------------+ ``` -## keyword +### keywords REPLACE diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/reverse.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/reverse.md index 1daf7802e393a1..19477b05b4337d 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/reverse.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/reverse.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# reverse -## description -### Syntax +## reverse +### description +#### Syntax `VARCHAR reverse(VARCHAR str)` 将字符串反转,返回的字符串的顺序和源字符串的顺序相反。 -## example +### example ``` mysql> SELECT REVERSE('hello'); @@ -52,5 +52,5 @@ mysql> SELECT REVERSE('你好'); +------------------+ 1 row in set (0.00 sec) ``` -## keyword +### keywords REVERSE diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/right.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/right.md index 5a28f59af6bd1f..ec8d1bf42d1f09 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/right.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/right.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# right -## description -### Syntax +## right +### description +#### Syntax `VARCHAR right(VARCHAR str)` 它返回具有指定长度的字符串的右边部分, 长度的单位为utf8字符 -## example +### example ``` mysql> select right("Hello doris",5); @@ -43,5 +43,5 @@ mysql> select right("Hello doris",5); | doris | +-------------------------+ ``` -## keyword +### keywords RIGHT diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/rpad.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/rpad.md index b44b0d7862760f..f7361efd7327d7 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/rpad.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/rpad.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# rpad -## description -### Syntax +## rpad +### description +#### Syntax `VARCHAR rpad(VARCHAR str, INT len, VARCHAR pad)` 返回 str 中长度为 len(从首字母开始算起)的字符串。如果 len 大于 str 的长度,则在 str 的后面不断补充 pad 字符,直到该字符串的长度达到 len 为止。如果 len 小于 str 的长度,该函数相当于截断 str 字符串,只返回长度为 len 的字符串。len 指的是字符长度而不是字节长度。 -## example +### example ``` mysql> SELECT rpad("hi", 5, "xy"); @@ -50,5 +50,5 @@ mysql> SELECT rpad("hi", 1, "xy"); | h | +---------------------+ ``` -## keyword +### keywords RPAD diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/split_part.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/split_part.md index 67c0d6504a887b..204a202c32f283 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/split_part.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/split_part.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# split_part -## description -### Syntax +## split_part +### description +#### Syntax `VARCHAR split_part(VARCHAR content, VARCHAR delimiter, INT field)` 根据分割符拆分字符串, 返回指定的分割部分(从一开始计数)。 -## example +### example ``` mysql> select split_part("hello world", " ", 1); @@ -65,5 +65,5 @@ mysql> select split_part("abca", "a", 1); | | +----------------------------+ ``` -## keyword +### keywords SPLIT_PART,SPLIT,PART diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/starts_with.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/starts_with.md index 98c5582cecc885..e6a7308b1174a8 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/starts_with.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/starts_with.md @@ -24,15 +24,15 @@ specific language governing permissions and limitations under the License. --> -# starts_with -## description -### Syntax +## starts_with +### description +#### Syntax `BOOLEAN STARTS_WITH (VARCHAR str, VARCHAR prefix)` 如果字符串以指定前缀开头,返回true。否则,返回false。任意参数为NULL,返回NULL。 -## example +### example ``` MySQL [(none)]> select starts_with("hello world","hello"); @@ -49,5 +49,5 @@ MySQL [(none)]> select starts_with("hello world","world"); | 0 | +-------------------------------------+ ``` -## keyword -STARTS_WITH \ No newline at end of file +### keywords +STARTS_WITH diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/strleft.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/strleft.md index 5be123c23d1526..47f3cd967cd4fb 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/strleft.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/strleft.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# strleft -## description -### Syntax +## strleft +### description +#### Syntax `VARCHAR strleft(VARCHAR str)` 它返回具有指定长度的字符串的左边部分,长度的单位为utf8字符 -## example +### example ``` mysql> select strleft("Hello doris",5); @@ -43,5 +43,5 @@ mysql> select strleft("Hello doris",5); | Hello | +------------------------+ ``` -## keyword +### keywords STRLEFT diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/strright.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/strright.md index 67d2fd4348a3b7..10b090f864ee07 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/strright.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/strright.md @@ -24,16 +24,16 @@ specific language governing permissions and limitations under the License. --> -# strright -## description -### Syntax +## strright +### description +#### Syntax `VARCHAR strright(VARCHAR str)` 它返回具有指定长度的字符串的右边部分, 长度的单位为utf8字符 -## example +### example ``` mysql> select strright("Hello doris",5); @@ -43,5 +43,5 @@ mysql> select strright("Hello doris",5); | doris | +-------------------------+ ``` -## keyword +### keywords STRRIGHT diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/substring.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/substring.md index c56bc989fa2cf1..736551de554978 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/substring.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/substring.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# substring -## description -### Syntax +## substring +### description +#### Syntax `VARCHAR substring(VARCHAR str, INT pos[, INT len])` @@ -37,7 +37,7 @@ under the License. 对于所有形式的 SUBSTRING(),要从中提取子字符串的字符串中第一个字符的位置为1。 -## example +### example ``` mysql> select substring('abc1', 2); @@ -68,5 +68,5 @@ mysql> select substring('abc1def', 2, 2); | bc | +-----------------------------+ ``` -## keyword +### keywords SUBSTRING diff --git a/docs/zh-CN/sql-manual/sql-functions/string-functions/unhex.md b/docs/zh-CN/sql-manual/sql-functions/string-functions/unhex.md index f33e75d73e8173..a8af9f1a8e326d 100644 --- a/docs/zh-CN/sql-manual/sql-functions/string-functions/unhex.md +++ b/docs/zh-CN/sql-manual/sql-functions/string-functions/unhex.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# unhex -## description -### Syntax +## unhex +### description +#### Syntax `VARCHAR unhex(VARCHAR str)` @@ -35,7 +35,7 @@ under the License. 其他情况每两个字符为一组转化为16进制后的字符,然后拼接成字符串输出 -## example +### example ``` mysql> select unhex('@'); @@ -59,5 +59,5 @@ mysql> select unhex('4142'); | AB | +---------------+ ``` -## keyword +### keywords UNHEX diff --git a/docs/zh-CN/sql-manual/sql-functions/table-functions/explode-bitmap.md b/docs/zh-CN/sql-manual/sql-functions/table-functions/explode-bitmap.md index e6302f46f35be1..22af7a2711648b 100644 --- a/docs/zh-CN/sql-manual/sql-functions/table-functions/explode-bitmap.md +++ b/docs/zh-CN/sql-manual/sql-functions/table-functions/explode-bitmap.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# explode_bitmap +## explode_bitmap -## description +### description 表函数,需配合 Lateral View 使用。 @@ -38,7 +38,7 @@ under the License. explode_bitmap(bitmap) ``` -## example +### example 原表数据: @@ -143,6 +143,6 @@ lateral view explode_split("a,b", ",") tmp2 as e2 order by k1, e1, e2; +------+------+------+ ``` -## keyword +### keywords - explode_bitmap \ No newline at end of file + explode_bitmap diff --git a/docs/zh-CN/sql-manual/sql-functions/table-functions/explode-json-array.md b/docs/zh-CN/sql-manual/sql-functions/table-functions/explode-json-array.md index d5a08f8140d090..08b0eae9473308 100644 --- a/docs/zh-CN/sql-manual/sql-functions/table-functions/explode-json-array.md +++ b/docs/zh-CN/sql-manual/sql-functions/table-functions/explode-json-array.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# `explode_json_array` +## `explode_json_array` -## description +### description 表函数,需配合 Lateral View 使用。 @@ -40,7 +40,7 @@ explode_json_array_double(json_str) explode_json_array_string(json_str) ``` -## example +### example 原表数据: @@ -182,6 +182,6 @@ mysql> select k1, e1 from example1 lateral view explode_json_array_string('{"a": Empty set ``` -## keyword +### keywords - explode_json_array \ No newline at end of file + explode_json_array diff --git a/docs/zh-CN/sql-manual/sql-functions/table-functions/explode-numbers.md b/docs/zh-CN/sql-manual/sql-functions/table-functions/explode-numbers.md index 66e7f54dc2b786..30c7edeb6cb255 100644 --- a/docs/zh-CN/sql-manual/sql-functions/table-functions/explode-numbers.md +++ b/docs/zh-CN/sql-manual/sql-functions/table-functions/explode-numbers.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# explode_numbers +## explode_numbers -## description +### description 表函数,需配合 Lateral View 使用。 @@ -38,7 +38,7 @@ under the License. explode_numbers(n) ``` -## example +### example ``` mysql> select e1 from (select 1 k1) as t lateral view explode_numbers(5) tmp1 as e1; @@ -52,6 +52,6 @@ mysql> select e1 from (select 1 k1) as t lateral view explode_numbers(5) tmp1 as | 4 | +------+ ``` -## keyword +### keywords - explode_numbers \ No newline at end of file + explode_numbers diff --git a/docs/zh-CN/sql-manual/sql-functions/table-functions/explode-split.md b/docs/zh-CN/sql-manual/sql-functions/table-functions/explode-split.md index 6bc0ea3fe7cc12..df2a12d6592852 100644 --- a/docs/zh-CN/sql-manual/sql-functions/table-functions/explode-split.md +++ b/docs/zh-CN/sql-manual/sql-functions/table-functions/explode-split.md @@ -24,9 +24,9 @@ specific language governing permissions and limitations under the License. --> -# explode_split +## explode_split -## description +### description 表函数,需配合 Lateral View 使用。 @@ -38,7 +38,7 @@ under the License. explode_split(str, delimiter) ``` -## example +### example 原表数据: @@ -103,6 +103,6 @@ mysql> select k1, e1 from example1 lateral view explode_split(k2, ',') tmp1 as e +------+------+ ``` -## keyword +### keywords - explode_split \ No newline at end of file + explode_split diff --git a/docs/zh-CN/sql-manual/sql-functions/table-functions/outer-combinator.md b/docs/zh-CN/sql-manual/sql-functions/table-functions/outer-combinator.md index ef9f97047edbb8..c4ddf07db52fa2 100644 --- a/docs/zh-CN/sql-manual/sql-functions/table-functions/outer-combinator.md +++ b/docs/zh-CN/sql-manual/sql-functions/table-functions/outer-combinator.md @@ -24,13 +24,13 @@ specific language governing permissions and limitations under the License. --> -# outer组合器 +## outer组合器 -## description +### description 在table function的函数名后面添加`_outer`后缀使得函数行为从`non-outer`变为`outer`,在表函数生成0行数据时添加一行`Null`数据。 -## example +### example ``` mysql> select e1 from (select 1 k1) as t lateral view explode_numbers(0) tmp1 as e1; @@ -43,6 +43,6 @@ mysql> select e1 from (select 1 k1) as t lateral view explode_numbers_outer(0) t | NULL | +------+ ``` -## keyword +### keywords - outer \ No newline at end of file + outer diff --git a/docs/zh-CN/sql-manual/sql-functions/window-function.md b/docs/zh-CN/sql-manual/sql-functions/window-function.md deleted file mode 100644 index 7cbde40c307618..00000000000000 --- a/docs/zh-CN/sql-manual/sql-functions/window-function.md +++ /dev/null @@ -1,487 +0,0 @@ ---- -{ - "title": "窗口函数", - "language": "zh-CN" -} ---- - - - -# Doris 窗口函数使用 - -## 窗口函数介绍 - -分析函数是一类特殊的内置函数。和聚合函数类似,分析函数也是对于多个输入行做计算得到一个数据值。不同的是,分析函数是在一个特定的窗口内对输入数据做处理,而不是按照 group by 来分组计算。每个窗口内的数据可以用 over() 从句进行排序和分组。分析函数会对结果集的每一行计算出一个单独的值,而不是每个 group by 分组计算一个值。这种灵活的方式允许用户在 select 从句中增加额外的列,给用户提供了更多的机会来对结果集进行重新组织和过滤。分析函数只能出现在 select 列表和最外层的 order by 从句中。在查询过程中,分析函数会在最后生效,就是说,在执行完 join,where 和 group by 等操作之后再执行。分析函数在金融和科学计算领域经常被使用到,用来分析趋势、计算离群值以及对大量数据进行分桶分析等。 - -分析函数的语法: - -```sql -function(args) OVER(partition_by_clause order_by_clause [window_clause]) -partition_by_clause ::= PARTITION BY expr [, expr ...] -order_by_clause ::= ORDER BY expr [ASC | DESC] [, expr [ASC | DESC] ...] -``` - -### Function - -目前支持的 Function 包括 AVG(), COUNT(), DENSE_RANK(), FIRST_VALUE(), LAG(), LAST_VALUE(), LEAD(), MAX(), MIN(), RANK(), ROW_NUMBER() 和 SUM()。 - -### PARTITION BY从句 - -Partition By 从句和 Group By 类似。它把输入行按照指定的一列或多列分组,相同值的行会被分到一组。 - -### ORDER BY从句 - -Order By从句和外层的Order By基本一致。它定义了输入行的排列顺序,如果指定了 Partition By,则 Order By 定义了每个 Partition 分组内的顺序。与外层 Order By 的唯一不同点是,OVER 从句中的 Order By n(n是正整数)相当于不做任何操作,而外层的 Order By n表示按照第n列排序。 - -举例: - -这个例子展示了在select列表中增加一个id列,它的值是1,2,3等等,顺序按照events表中的date_and_time列排序。 - -```sql -SELECT -row_number() OVER (ORDER BY date_and_time) AS id, -c1, c2, c3, c4 -FROM events; -``` - -### Window从句 - -Window 从句用来为分析函数指定一个运算范围,以当前行为准,前后若干行作为分析函数运算的对象。Window 从句支持的方法有:AVG(), COUNT(), FIRST_VALUE(), LAST_VALUE() 和 SUM()。对于 MAX() 和 MIN(), window 从句可以指定开始范围 UNBOUNDED PRECEDING - -语法: - -```sql -ROWS BETWEEN [ { m | UNBOUNDED } PRECEDING | CURRENT ROW] [ AND [CURRENT ROW | { UNBOUNDED | n } FOLLOWING] ] -``` - -### 举例: - -假设我们有如下的股票数据,股票代码是 JDR,closing price 是每天的收盘价。 - -```sql -create table stock_ticker (stock_symbol string, closing_price decimal(8,2), closing_date timestamp); -...load some data... -select * from stock_ticker order by stock_symbol, closing_date - | stock_symbol | closing_price | closing_date | - |--------------|---------------|---------------------| - | JDR | 12.86 | 2014-10-02 00:00:00 | - | JDR | 12.89 | 2014-10-03 00:00:00 | - | JDR | 12.94 | 2014-10-04 00:00:00 | - | JDR | 12.55 | 2014-10-05 00:00:00 | - | JDR | 14.03 | 2014-10-06 00:00:00 | - | JDR | 14.75 | 2014-10-07 00:00:00 | - | JDR | 13.98 | 2014-10-08 00:00:00 | -``` - -这个查询使用分析函数产生 moving_average 这一列,它的值是3天的股票均价,即前一天、当前以及后一天三天的均价。第一天没有前一天的值,最后一天没有后一天的值,所以这两行只计算了两天的均值。这里 Partition By 没有起到作用,因为所有的数据都是 JDR 的数据,但如果还有其他股票信息,Partition By 会保证分析函数值作用在本 Partition 之内。 - -```sql -select stock_symbol, closing_date, closing_price, -avg(closing_price) over (partition by stock_symbol order by closing_date -rows between 1 preceding and 1 following) as moving_average -from stock_ticker; - | stock_symbol | closing_date | closing_price | moving_average | - |--------------|---------------------|---------------|----------------| - | JDR | 2014-10-02 00:00:00 | 12.86 | 12.87 | - | JDR | 2014-10-03 00:00:00 | 12.89 | 12.89 | - | JDR | 2014-10-04 00:00:00 | 12.94 | 12.79 | - | JDR | 2014-10-05 00:00:00 | 12.55 | 13.17 | - | JDR | 2014-10-06 00:00:00 | 14.03 | 13.77 | - | JDR | 2014-10-07 00:00:00 | 14.75 | 14.25 | - | JDR | 2014-10-08 00:00:00 | 13.98 | 14.36 | -``` - -## Function使用举例 - -本节介绍 Doris 中可以用作分析函数的方法。 - -### AVG() - -语法: - -```sql -AVG([DISTINCT | ALL] *expression*) [OVER (*analytic_clause*)] -``` - -举例: - -计算当前行和它前后各一行数据的x平均值 - -```sql -select x, property, -avg(x) over -( -partition by property -order by x -rows between 1 preceding and 1 following -) as 'moving average' -from int_t where property in ('odd','even'); - | x | property | moving average | - |----|----------|----------------| - | 2 | even | 3 | - | 4 | even | 4 | - | 6 | even | 6 | - | 8 | even | 8 | - | 10 | even | 9 | - | 1 | odd | 2 | - | 3 | odd | 3 | - | 5 | odd | 5 | - | 7 | odd | 7 | - | 9 | odd | 8 | -``` - -### COUNT() - -语法: - -```sql -COUNT([DISTINCT | ALL] expression) [OVER (analytic_clause)] -``` - -举例: - -计算从当前行到第一行x出现的次数。 - -```sql -select x, property, -count(x) over -( -partition by property -order by x -rows between unbounded preceding and current row -) as 'cumulative total' -from int_t where property in ('odd','even'); - | x | property | cumulative count | - |----|----------|------------------| - | 2 | even | 1 | - | 4 | even | 2 | - | 6 | even | 3 | - | 8 | even | 4 | - | 10 | even | 5 | - | 1 | odd | 1 | - | 3 | odd | 2 | - | 5 | odd | 3 | - | 7 | odd | 4 | - | 9 | odd | 5 | -``` - -### DENSE_RANK() - -DENSE_RANK() 函数用来表示排名,与RANK()不同的是,DENSE_RANK() 不会出现空缺数字。比如,如果出现了两个并列的1,DENSE_RANK() 的第三个数仍然是2,而RANK()的第三个数是3。 - -语法: - -```sql -DENSE_RANK() OVER(partition_by_clause order_by_clause) -``` - -举例: - -下例展示了按照 property 列分组对x列排名: - -```sql - select x, y, dense_rank() over(partition by x order by y) as rank from int_t; - | x | y | rank | - |----|------|----------| - | 1 | 1 | 1 | - | 1 | 2 | 2 | - | 1 | 2 | 2 | - | 2 | 1 | 1 | - | 2 | 2 | 2 | - | 2 | 3 | 3 | - | 3 | 1 | 1 | - | 3 | 1 | 1 | - | 3 | 2 | 2 | -``` - -### FIRST_VALUE() - -FIRST_VALUE() 返回窗口范围内的第一个值。 - -语法: - -```sql -FIRST_VALUE(expr) OVER(partition_by_clause order_by_clause [window_clause]) -``` - -举例: - -我们有如下数据 - -```sql - select name, country, greeting from mail_merge; - | name | country | greeting | - |---------|---------|--------------| - | Pete | USA | Hello | - | John | USA | Hi | - | Boris | Germany | Guten tag | - | Michael | Germany | Guten morgen | - | Bjorn | Sweden | Hej | - | Mats | Sweden | Tja | -``` - -使用 FIRST_VALUE(),根据 country 分组,返回每个分组中第一个 greeting 的值: - -```sql -select country, name, -first_value(greeting) -over (partition by country order by name, greeting) as greeting from mail_merge; -| country | name | greeting | -|---------|---------|-----------| -| Germany | Boris | Guten tag | -| Germany | Michael | Guten tag | -| Sweden | Bjorn | Hej | -| Sweden | Mats | Hej | -| USA | John | Hi | -| USA | Pete | Hi | -``` - -### LAG() - -LAG() 方法用来计算当前行向前数若干行的值。 - -语法: - -```sql -LAG (expr, offset, default) OVER (partition_by_clause order_by_clause) -``` - -举例: - -计算前一天的收盘价 - -```sql -select stock_symbol, closing_date, closing_price, -lag(closing_price,1, 0) over (partition by stock_symbol order by closing_date) as "yesterday closing" -from stock_ticker -order by closing_date; -| stock_symbol | closing_date | closing_price | yesterday closing | -|--------------|---------------------|---------------|-------------------| -| JDR | 2014-09-13 00:00:00 | 12.86 | 0 | -| JDR | 2014-09-14 00:00:00 | 12.89 | 12.86 | -| JDR | 2014-09-15 00:00:00 | 12.94 | 12.89 | -| JDR | 2014-09-16 00:00:00 | 12.55 | 12.94 | -| JDR | 2014-09-17 00:00:00 | 14.03 | 12.55 | -| JDR | 2014-09-18 00:00:00 | 14.75 | 14.03 | -| JDR | 2014-09-19 00:00:00 | 13.98 | 14.75 | -``` - -### LAST_VALUE() - -LAST_VALUE() 返回窗口范围内的最后一个值。与 FIRST_VALUE() 相反。 - -语法: - -```sql -LAST_VALUE(expr) OVER(partition_by_clause order_by_clause [window_clause]) -``` - -使用FIRST_VALUE()举例中的数据: - -```sql -select country, name, -last_value(greeting) -over (partition by country order by name, greeting) as greeting -from mail_merge; -| country | name | greeting | -|---------|---------|--------------| -| Germany | Boris | Guten morgen | -| Germany | Michael | Guten morgen | -| Sweden | Bjorn | Tja | -| Sweden | Mats | Tja | -| USA | John | Hello | -| USA | Pete | Hello | -``` - -### LEAD() - -LEAD() 方法用来计算当前行向后数若干行的值。 - -语法: - -```sql -LEAD (expr, offset, default]) OVER (partition_by_clause order_by_clause) -``` - -举例: - -计算第二天的收盘价对比当天收盘价的走势,即第二天收盘价比当天高还是低。 - -```sql -select stock_symbol, closing_date, closing_price, -case -(lead(closing_price,1, 0) -over (partition by stock_symbol order by closing_date)-closing_price) > 0 -when true then "higher" -when false then "flat or lower" -end as "trending" -from stock_ticker -order by closing_date; -| stock_symbol | closing_date | closing_price | trending | -|--------------|---------------------|---------------|---------------| -| JDR | 2014-09-13 00:00:00 | 12.86 | higher | -| JDR | 2014-09-14 00:00:00 | 12.89 | higher | -| JDR | 2014-09-15 00:00:00 | 12.94 | flat or lower | -| JDR | 2014-09-16 00:00:00 | 12.55 | higher | -| JDR | 2014-09-17 00:00:00 | 14.03 | higher | -| JDR | 2014-09-18 00:00:00 | 14.75 | flat or lower | -| JDR | 2014-09-19 00:00:00 | 13.98 | flat or lower | -``` - -### MAX() - -语法: - -```sql -MAX([DISTINCT | ALL] expression) [OVER (analytic_clause)] -``` - -举例: - -计算从第一行到当前行之后一行的最大值 - -```sql -select x, property, -max(x) over -( -order by property, x -rows between unbounded preceding and 1 following -) as 'local maximum' -from int_t where property in ('prime','square'); -| x | property | local maximum | -|---|----------|---------------| -| 2 | prime | 3 | -| 3 | prime | 5 | -| 5 | prime | 7 | -| 7 | prime | 7 | -| 1 | square | 7 | -| 4 | square | 9 | -| 9 | square | 9 | -``` - -### MIN() - -语法: - -```sql -MIN([DISTINCT | ALL] expression) [OVER (analytic_clause)] -``` - -举例: - -计算从第一行到当前行之后一行的最小值 - -```sql -select x, property, -min(x) over -( -order by property, x desc -rows between unbounded preceding and 1 following -) as 'local minimum' -from int_t where property in ('prime','square'); -| x | property | local minimum | -|---|----------|---------------| -| 7 | prime | 5 | -| 5 | prime | 3 | -| 3 | prime | 2 | -| 2 | prime | 2 | -| 9 | square | 2 | -| 4 | square | 1 | -| 1 | square | 1 | -``` - -### RANK() - -RANK() 函数用来表示排名,与 DENSE_RANK() 不同的是,RANK() 会出现空缺数字。比如,如果出现了两个并列的1, RANK() 的第三个数就是3,而不是2。 - -语法: - -```sql -RANK() OVER(partition_by_clause order_by_clause) -``` - -举例: - -根据 x 进行排名 - -```sql -select x, y, rank() over(partition by x order by y) as rank from int_t; -| x | y | rank | -|----|------|----------| -| 1 | 1 | 1 | -| 1 | 2 | 2 | -| 1 | 2 | 2 | -| 2 | 1 | 1 | -| 2 | 2 | 2 | -| 2 | 3 | 3 | -| 3 | 1 | 1 | -| 3 | 1 | 1 | -| 3 | 2 | 3 | -``` - -### ROW_NUMBER() - -为每个 Partition 的每一行返回一个从1开始连续递增的整数。与 RANK() 和 DENSE_RANK() 不同的是,ROW_NUMBER() 返回的值不会重复也不会出现空缺,是连续递增的。 - -语法: - -```sql -ROW_NUMBER() OVER(partition_by_clause order_by_clause) -``` - -举例: - -```sql -select x, y, row_number() over(partition by x order by y) as rank from int_t; -| x | y | rank | -|---|------|----------| -| 1 | 1 | 1 | -| 1 | 2 | 2 | -| 1 | 2 | 3 | -| 2 | 1 | 1 | -| 2 | 2 | 2 | -| 2 | 3 | 3 | -| 3 | 1 | 1 | -| 3 | 1 | 2 | -| 3 | 2 | 3 | -``` - -### SUM() - -语法: - -```sql -SUM([DISTINCT | ALL] expression) [OVER (analytic_clause)] -``` - -举例: - -按照 property 进行分组,在组内计算当前行以及前后各一行的x列的和。 - -```sql -select x, property, -sum(x) over -( -partition by property -order by x -rows between 1 preceding and 1 following -) as 'moving total' -from int_t where property in ('odd','even'); -| x | property | moving total | -|----|----------|--------------| -| 2 | even | 6 | -| 4 | even | 12 | -| 6 | even | 18 | -| 8 | even | 24 | -| 10 | even | 18 | -| 1 | odd | 4 | -| 3 | odd | 9 | -| 5 | odd | 15 | -| 7 | odd | 21 | -| 9 | odd | 16 | -``` - diff --git a/docs/zh-CN/sql-manual/sql-reference/Account-Management-Statements/REVOKE.md b/docs/zh-CN/sql-manual/sql-reference/Account-Management-Statements/REVOKE.md index 00898e9cd3c1a7..26fb4e824e044c 100644 --- a/docs/zh-CN/sql-manual/sql-reference/Account-Management-Statements/REVOKE.md +++ b/docs/zh-CN/sql-manual/sql-reference/Account-Management-Statements/REVOKE.md @@ -32,7 +32,7 @@ REVOKE ### Description - REVOKE 命令用于撤销指定用户或角色指定的权限。 +REVOKE 命令用于撤销指定用户或角色指定的权限。 ```sql REVOKE privilege_list ON db_name[.tbl_name] FROM user_identity [ROLE role_name] diff --git a/docs/zh-CN/sql-manual/sql-reference/Data-Definition-Statements/Backup-and-Restore/RECOVER.md b/docs/zh-CN/sql-manual/sql-reference/Data-Definition-Statements/Backup-and-Restore/RECOVER.md deleted file mode 100644 index 6d34b87ad1d767..00000000000000 --- a/docs/zh-CN/sql-manual/sql-reference/Data-Definition-Statements/Backup-and-Restore/RECOVER.md +++ /dev/null @@ -1,89 +0,0 @@ ---- -{ - "title": "RECOVER", - "language": "zh-CN" -} ---- - - - -## RECOVER - -### Name - -REVOCER - -### Description - -该语句用于恢复之前删除的 database、table 或者 partition - -语法: - -1. 恢复 database - - ```sql - RECOVER DATABASE db_name; - ``` - -2. 恢复 table - - ```sql - RECOVER TABLE [db_name.]table_name; - ``` - -3. 恢复 partition - - ```sql - RECOVER PARTITION partition_name FROM [db_name.]table_name; - ``` - - - -说明: - -- 该操作仅能恢复之前一段时间内删除的元信息。默认为 1 天。(可通过fe.conf中`catalog_trash_expire_second`参数配置) -- 如果删除元信息后新建立了同名同类型的元信息,则之前删除的元信息不能被恢复 - -### Example - -1. 恢复名为 example_db 的 database - -```sql -RECOVER DATABASE example_db; -``` - -2. 恢复名为 example_tbl 的 table - -```sql -RECOVER TABLE example_db.example_tbl; -``` - -3. 恢复表 example_tbl 中名为 p1 的 partition - -```sql -RECOVER PARTITION p1 FROM example_tbl; -``` - -### Keywords - - RECOVER - -### Best Practice - diff --git a/docs/zh-CN/sql-manual/sql-reference/Data-Manipulation-Statements/Load/MULTI-LOAD.md b/docs/zh-CN/sql-manual/sql-reference/Data-Manipulation-Statements/Load/MULTI-LOAD.md index 86fed7405a32e3..4bf8db4384dcf0 100644 --- a/docs/zh-CN/sql-manual/sql-reference/Data-Manipulation-Statements/Load/MULTI-LOAD.md +++ b/docs/zh-CN/sql-manual/sql-reference/Data-Manipulation-Statements/Load/MULTI-LOAD.md @@ -24,7 +24,7 @@ specific language governing permissions and limitations under the License. --> -# MULTI-LOAD +## MULTI-LOAD ### Name @@ -114,7 +114,7 @@ NOTE: curl --location-trusted -u root -XPOST http://host:port/api/testDb/_multi_desc?label=123 ``` -### Keyword +### Keywords ``` MULTI, MINI, LOAD diff --git a/docs/zh-CN/sql-manual/sql-reference/Data-Manipulation-Statements/OUTFILE.md b/docs/zh-CN/sql-manual/sql-reference/Data-Manipulation-Statements/OUTFILE.md index 6442da5fa5532d..fee56b66c015c5 100644 --- a/docs/zh-CN/sql-manual/sql-reference/Data-Manipulation-Statements/OUTFILE.md +++ b/docs/zh-CN/sql-manual/sql-reference/Data-Manipulation-Statements/OUTFILE.md @@ -24,13 +24,13 @@ specific language governing permissions and limitations under the License. --> -# OUTFILE +## OUTFILE ### Name OURFILE -## description +### description 该语句用于使用 `SELECT INTO OUTFILE` 命令将查询结果的导出为文件。目前支持通过 Broker 进程, 通过 S3 协议, 或直接通过 HDFS 协议,导出到远端存储,如 HDFS,S3,BOS,COS(腾讯云)上。 @@ -85,7 +85,7 @@ INTO OUTFILE "file_path" AWS_SECRET_KEY AWS_REGION -## example +### example 1. 使用 broker 方式导出,将简单查询结果导出到文件 `hdfs://path/to/result.txt`。指定导出格式为 CSV。使用 `my_broker` 并设置 kerberos 认证信息。指定列分隔符为 `,`,行分隔符为 `\n`。 @@ -247,7 +247,7 @@ INTO OUTFILE "file_path" 最终生成文件如如果不大于 100MB,则为:`result_0.csv`。 如果大于 100MB,则可能为 `result_0.csv, result_1.csv, ...`。 -## keyword +### keywords SELECT, INTO, OUTFILE ### Best Practice diff --git a/docs/zh-CN/sql-manual/sql-reference/Data-Types/BIGINT.md b/docs/zh-CN/sql-manual/sql-reference/Data-Types/BIGINT.md index 4af2a2ea2e2c5a..722acb73a0b6f1 100644 --- a/docs/zh-CN/sql-manual/sql-reference/Data-Types/BIGINT.md +++ b/docs/zh-CN/sql-manual/sql-reference/Data-Types/BIGINT.md @@ -24,11 +24,11 @@ specific language governing permissions and limitations under the License. --> -# BIGINT -## description +## BIGINT +### description BIGINT 8字节有符号整数,范围[-9223372036854775808, 9223372036854775807] -## keyword +### keywords BIGINT diff --git a/docs/zh-CN/sql-manual/sql-reference/Data-Types/BITMAP.md b/docs/zh-CN/sql-manual/sql-reference/Data-Types/BITMAP.md index c92e20b99407b5..acee6ca688648f 100644 --- a/docs/zh-CN/sql-manual/sql-reference/Data-Types/BITMAP.md +++ b/docs/zh-CN/sql-manual/sql-reference/Data-Types/BITMAP.md @@ -24,8 +24,8 @@ specific language governing permissions and limitations under the License. --> -# BITMAP -## description +## BITMAP +### description BITMAP BITMAP不能作为key列使用,建表时配合聚合类型为BITMAP_UNION。 用户不需要指定长度和默认值。长度根据数据的聚合程度系统内控制。 @@ -34,7 +34,7 @@ under the License. 离线场景下使用BITMAP会影响导入速度,在数据量大的情况下查询速度会慢于HLL,并优于Count Distinct。 注意:实时场景下BITMAP如果不使用全局字典,使用了bitmap_hash()可能会导致有千分之一左右的误差。 -## example +### example select hour, BITMAP_UNION_COUNT(pv) over(order by hour) uv from( select hour, BITMAP_UNION(device_id) as pv @@ -43,6 +43,6 @@ under the License. group by hour order by 1 ) final; -## keyword +### keywords BITMAP diff --git a/docs/zh-CN/sql-manual/sql-reference/Data-Types/BOOLEAN.md b/docs/zh-CN/sql-manual/sql-reference/Data-Types/BOOLEAN.md index e3e3a724f8f80b..1dbd287fde40b5 100644 --- a/docs/zh-CN/sql-manual/sql-reference/Data-Types/BOOLEAN.md +++ b/docs/zh-CN/sql-manual/sql-reference/Data-Types/BOOLEAN.md @@ -24,11 +24,11 @@ specific language governing permissions and limitations under the License. --> -# BOOLEAN -## description +## BOOLEAN +### description BOOL, BOOLEAN 与TINYINT一样,0代表false,1代表true -## keyword +### keywords BOOLEAN diff --git a/docs/zh-CN/sql-manual/sql-reference/Data-Types/CHAR.md b/docs/zh-CN/sql-manual/sql-reference/Data-Types/CHAR.md index fa204f4c1bc27f..007a7a2733aad9 100644 --- a/docs/zh-CN/sql-manual/sql-reference/Data-Types/CHAR.md +++ b/docs/zh-CN/sql-manual/sql-reference/Data-Types/CHAR.md @@ -24,11 +24,11 @@ specific language governing permissions and limitations under the License. --> -# CHAR -## description +## CHAR +### description CHAR(M) 定长字符串,M代表的是定长字符串的长度。M的范围是1-255 -## keyword +### keywords CHAR diff --git a/docs/zh-CN/sql-manual/sql-reference/Data-Types/DATE.md b/docs/zh-CN/sql-manual/sql-reference/Data-Types/DATE.md index e832cb1244dd1c..bc4616c84f5ff7 100644 --- a/docs/zh-CN/sql-manual/sql-reference/Data-Types/DATE.md +++ b/docs/zh-CN/sql-manual/sql-reference/Data-Types/DATE.md @@ -24,8 +24,8 @@ specific language governing permissions and limitations under the License. --> -# DATE -## description +## DATE +### description DATE函数 Syntax: DATE(expr) @@ -33,10 +33,10 @@ under the License. DATE类型 日期类型,目前的取值范围是['0000-01-01', '9999-12-31'], 默认的打印形式是'YYYY-MM-DD' -## example +### example mysql> SELECT DATE('2003-12-31 01:02:03'); -> '2003-12-31' -## keyword +### keywords DATE diff --git a/docs/zh-CN/sql-manual/sql-reference/Data-Types/DATETIME.md b/docs/zh-CN/sql-manual/sql-reference/Data-Types/DATETIME.md index 9872f5f20aa7e2..1c400e0d91bf99 100644 --- a/docs/zh-CN/sql-manual/sql-reference/Data-Types/DATETIME.md +++ b/docs/zh-CN/sql-manual/sql-reference/Data-Types/DATETIME.md @@ -24,12 +24,12 @@ specific language governing permissions and limitations under the License. --> -# DATETIME -## description +## DATETIME +### description DATETIME 日期时间类型,取值范围是['0000-01-01 00:00:00', '9999-12-31 23:59:59']. 打印的形式是'YYYY-MM-DD HH:MM:SS' -## keyword +### keywords DATETIME diff --git a/docs/zh-CN/sql-manual/sql-reference/Data-Types/DECIMAL.md b/docs/zh-CN/sql-manual/sql-reference/Data-Types/DECIMAL.md index 570d2554354b79..64c7dd81c967c9 100644 --- a/docs/zh-CN/sql-manual/sql-reference/Data-Types/DECIMAL.md +++ b/docs/zh-CN/sql-manual/sql-reference/Data-Types/DECIMAL.md @@ -24,12 +24,12 @@ specific language governing permissions and limitations under the License. --> -# DECIMAL -## description +## DECIMAL +### description DECIMAL(M[,D]) 高精度定点数,M代表一共有多少个有效数字(precision),D代表小数点后最多有多少数字(scale) M的范围是[1,27], D的范围[1, 9], 另外,M必须要大于等于D的取值。默认的D取值为0 -## keyword +### keywords DECIMAL diff --git a/docs/zh-CN/sql-manual/sql-reference/Data-Types/DOUBLE.md b/docs/zh-CN/sql-manual/sql-reference/Data-Types/DOUBLE.md index d6e659b87495df..327afe8b1ccc45 100644 --- a/docs/zh-CN/sql-manual/sql-reference/Data-Types/DOUBLE.md +++ b/docs/zh-CN/sql-manual/sql-reference/Data-Types/DOUBLE.md @@ -24,11 +24,11 @@ specific language governing permissions and limitations under the License. --> -# DOUBLE -## description +## DOUBLE +### description DOUBLE 8字节浮点数 -## keyword +### keywords DOUBLE diff --git a/docs/zh-CN/sql-manual/sql-reference/Data-Types/FLOAT.md b/docs/zh-CN/sql-manual/sql-reference/Data-Types/FLOAT.md index 454808d9065fa5..847f88ee340e2d 100644 --- a/docs/zh-CN/sql-manual/sql-reference/Data-Types/FLOAT.md +++ b/docs/zh-CN/sql-manual/sql-reference/Data-Types/FLOAT.md @@ -24,11 +24,11 @@ specific language governing permissions and limitations under the License. --> -# FLOAT -## description +## FLOAT +### description FLOAT 4字节浮点数 -## keyword +### keywords FLOAT diff --git a/docs/zh-CN/sql-manual/sql-reference/Data-Types/HLL.md b/docs/zh-CN/sql-manual/sql-reference/Data-Types/HLL.md index b261495d7ec384..0290eb82b8b8a7 100644 --- a/docs/zh-CN/sql-manual/sql-reference/Data-Types/HLL.md +++ b/docs/zh-CN/sql-manual/sql-reference/Data-Types/HLL.md @@ -24,8 +24,8 @@ specific language governing permissions and limitations under the License. --> -# HLL(HyperLogLog) -## description +## HLL(HyperLogLog) +### description HLL HLL不能作为key列使用,建表时配合聚合类型为HLL_UNION。 用户不需要指定长度和默认值。长度根据数据的聚合程度系统内控制。 @@ -34,7 +34,7 @@ under the License. HLL是模糊去重,在数据量大的情况性能优于Count Distinct。 HLL的误差通常在1%左右,有时会达到2%。 -## example +### example select hour, HLL_UNION_AGG(pv) over(order by hour) uv from( select hour, HLL_RAW_AGG(device_id) as pv @@ -43,6 +43,6 @@ under the License. group by hour order by 1 ) final; -## keyword +### keywords HLL,HYPERLOGLOG diff --git a/docs/zh-CN/sql-manual/sql-reference/Data-Types/INT.md b/docs/zh-CN/sql-manual/sql-reference/Data-Types/INT.md index e3943e5aad86a9..8c9e8791b4cf6c 100644 --- a/docs/zh-CN/sql-manual/sql-reference/Data-Types/INT.md +++ b/docs/zh-CN/sql-manual/sql-reference/Data-Types/INT.md @@ -24,11 +24,11 @@ specific language governing permissions and limitations under the License. --> -# INT -## description +## INT +### description INT 4字节有符号整数,范围[-2147483648, 2147483647] -## keyword +### keywords INT diff --git a/docs/zh-CN/sql-manual/sql-reference/Data-Types/LARGEINT.md b/docs/zh-CN/sql-manual/sql-reference/Data-Types/LARGEINT.md index b682817cfa5f90..3d233ee07085e2 100644 --- a/docs/zh-CN/sql-manual/sql-reference/Data-Types/LARGEINT.md +++ b/docs/zh-CN/sql-manual/sql-reference/Data-Types/LARGEINT.md @@ -24,10 +24,10 @@ specific language governing permissions and limitations under the License. --> -# LARGEINT -## description +## LARGEINT +### description LARGEINT 16字节有符号整数,范围[-2^127 + 1 ~ 2^127 - 1] -## keyword +### keywords LARGEINT diff --git a/docs/zh-CN/sql-manual/sql-reference/Data-Types/QUANTILE_STATE.md b/docs/zh-CN/sql-manual/sql-reference/Data-Types/QUANTILE-STATE.md similarity index 97% rename from docs/zh-CN/sql-manual/sql-reference/Data-Types/QUANTILE_STATE.md rename to docs/zh-CN/sql-manual/sql-reference/Data-Types/QUANTILE-STATE.md index 6b7af804f0ffd5..6e5f93096e9053 100644 --- a/docs/zh-CN/sql-manual/sql-reference/Data-Types/QUANTILE_STATE.md +++ b/docs/zh-CN/sql-manual/sql-reference/Data-Types/QUANTILE-STATE.md @@ -24,8 +24,8 @@ specific language governing permissions and limitations under the License. --> -# QUANTILE_STATE -## description +## QUANTILE_STATE +### description QUANTILE_STATE QUANTILE_STATE不能作为key列使用,建表时配合聚合类型为QUANTILE_UNION。 用户不需要指定长度和默认值。长度根据数据的聚合程度系统内控制。 @@ -49,10 +49,10 @@ under the License. -## example +### example select QUANTILE_PERCENT(QUANTILE_UNION(v1)) from test_table group by k1, k2, k3; -## keyword +### keywords QUANTILE_STATE, QUANTILE_UNION, TO_QUANTILE_STATE, QUANTILE_PERCENT diff --git a/docs/zh-CN/sql-manual/sql-reference/Data-Types/SMALLINT.md b/docs/zh-CN/sql-manual/sql-reference/Data-Types/SMALLINT.md index 40586b4ec8234b..751a57632b987b 100644 --- a/docs/zh-CN/sql-manual/sql-reference/Data-Types/SMALLINT.md +++ b/docs/zh-CN/sql-manual/sql-reference/Data-Types/SMALLINT.md @@ -24,11 +24,11 @@ specific language governing permissions and limitations under the License. --> -# SMALLINT -## description +## SMALLINT +### description SMALLINT 2字节有符号整数,范围[-32768, 32767] -## keyword +### keywords SMALLINT diff --git a/docs/zh-CN/sql-manual/sql-reference/Data-Types/STRING.md b/docs/zh-CN/sql-manual/sql-reference/Data-Types/STRING.md index 88fb608fca8cbb..1bdf4c64e25f00 100644 --- a/docs/zh-CN/sql-manual/sql-reference/Data-Types/STRING.md +++ b/docs/zh-CN/sql-manual/sql-reference/Data-Types/STRING.md @@ -24,13 +24,13 @@ specific language governing permissions and limitations under the License. --> -# STRING -## description +## STRING +### description STRING 变长字符串,最大支持2147483643 字节(2GB-4)。String类型的长度还受 be 配置 `string_type_soft_limit`, 实际能存储的最大长度 取两者最小值,String类型只能用在value 列,不能用在 key 列和分区 分桶列 注意:变长字符串是以UTF-8编码存储的,因此通常英文字符占1个字节,中文字符占3个字节。 -## keyword +### keywords STRING diff --git a/docs/zh-CN/sql-manual/sql-reference/Data-Types/TINYINT.md b/docs/zh-CN/sql-manual/sql-reference/Data-Types/TINYINT.md index 39e18da9e06859..704e579698ffeb 100644 --- a/docs/zh-CN/sql-manual/sql-reference/Data-Types/TINYINT.md +++ b/docs/zh-CN/sql-manual/sql-reference/Data-Types/TINYINT.md @@ -24,11 +24,11 @@ specific language governing permissions and limitations under the License. --> -# TINYINT -## description +## TINYINT +### description TINYINT 1字节有符号整数,范围[-128, 127] -## keyword +### keywords TINYINT diff --git a/docs/zh-CN/sql-manual/sql-reference/Data-Types/VARCHAR.md b/docs/zh-CN/sql-manual/sql-reference/Data-Types/VARCHAR.md index 5782c0303b4c16..16dab80ce26019 100644 --- a/docs/zh-CN/sql-manual/sql-reference/Data-Types/VARCHAR.md +++ b/docs/zh-CN/sql-manual/sql-reference/Data-Types/VARCHAR.md @@ -24,13 +24,13 @@ specific language governing permissions and limitations under the License. --> -# VARCHAR -## description +## VARCHAR +### description VARCHAR(M) 变长字符串,M代表的是变长字符串的字节长度。M的范围是1-65533。 注意:变长字符串是以UTF-8编码存储的,因此通常英文字符占1个字节,中文字符占3个字节。 -## keyword +### keywords VARCHAR diff --git a/docs/zh-CN/sql-manual/sql-reference/Database-Administration-Statements/ADMIN-SHOW-TABLET-STORAGE-FORMAT.md b/docs/zh-CN/sql-manual/sql-reference/Database-Administration-Statements/ADMIN-SHOW-TABLET-STORAGE-FORMAT.md index c7ff3440129270..ee87ea215ca29c 100644 --- a/docs/zh-CN/sql-manual/sql-reference/Database-Administration-Statements/ADMIN-SHOW-TABLET-STORAGE-FORMAT.md +++ b/docs/zh-CN/sql-manual/sql-reference/Database-Administration-Statements/ADMIN-SHOW-TABLET-STORAGE-FORMAT.md @@ -24,13 +24,13 @@ specific language governing permissions and limitations under the License. --> -# ADMIN SHOW TABLET STORAGE FORMAT -## description +## ADMIN SHOW TABLET STORAGE FORMAT +### description 该语句用于显示Backend上的存储格式信息(仅管理员使用) 语法: ADMIN SHOW TABLET STORAGE FORMAT [VERBOSE] -## example +### example MySQL [(none)]> admin show tablet storage format; +-----------+---------+---------+ | BackendId | V1Count | V2Count | @@ -48,6 +48,7 @@ under the License. | 10002 | 39199 | V2 | +-----------+----------+---------------+ 4 rows in set (0.034 sec) -## keyword + +### keywords ADMIN,SHOW,TABLET,STORAGE,FORMAT diff --git a/docs/zh-CN/sql-manual/sql-reference/Database-Administration-Statements/RECOVER.md b/docs/zh-CN/sql-manual/sql-reference/Database-Administration-Statements/RECOVER.md index e5312d5fa749c8..e25bbcd256a92e 100644 --- a/docs/zh-CN/sql-manual/sql-reference/Database-Administration-Statements/RECOVER.md +++ b/docs/zh-CN/sql-manual/sql-reference/Database-Administration-Statements/RECOVER.md @@ -32,52 +32,54 @@ RECOVER ### Description -该语句用于恢复之前删除的 database、table 或者 partition。 +该语句用于恢复之前删除的 database、table 或者 partition 语法: -1) 恢复 database - - ```sql - RECOVER DATABASE db_name; - ``` - -1) 恢复 table - - ```sql - RECOVER TABLE [db_name.]table_name; - ``` - -1) 恢复 partition - - ```sql - RECOVER PARTITION partition_name FROM [db_name.]table_name; - ``` +1. 恢复 database + + ```sql + RECOVER DATABASE db_name; + ``` + +2. 恢复 table + + ```sql + RECOVER TABLE [db_name.]table_name; + ``` + +3. 恢复 partition + + ```sql + RECOVER PARTITION partition_name FROM [db_name.]table_name; + ``` + + 说明: -1. 该操作仅能恢复之前一段时间内删除的元信息。默认为 1 天。(可通过fe.conf中`catalog_trash_expire_second`参数配置) -2. 如果删除元信息后新建立了同名同类型的元信息,则之前删除的元信息不能被恢复 +- 该操作仅能恢复之前一段时间内删除的元信息。默认为 1 天。(可通过fe.conf中`catalog_trash_expire_second`参数配置) +- 如果删除元信息后新建立了同名同类型的元信息,则之前删除的元信息不能被恢复 ### Example -1. 恢复名为 example_db 的 database; - - ```sql - RECOVER DATABASE example_db; - ``` - -1. 恢复名为 example_tbl 的 table - - ```sql - RECOVER TABLE example_db.example_tbl; - ``` - -1. 恢复表 example_tbl 中名为 p1 的 partition - - ```sql - RECOVER PARTITION p1 FROM example_tbl; - ``` +1. 恢复名为 example_db 的 database + +```sql +RECOVER DATABASE example_db; +``` + +2. 恢复名为 example_tbl 的 table + +```sql +RECOVER TABLE example_db.example_tbl; +``` + +3. 恢复表 example_tbl 中名为 p1 的 partition + +```sql +RECOVER PARTITION p1 FROM example_tbl; +``` ### Keywords diff --git a/fe/fe-core/src/main/java/org/apache/doris/common/MarkDownParser.java b/fe/fe-core/src/main/java/org/apache/doris/common/MarkDownParser.java index 0ad093ff91b40c..e6723b4838c8a7 100755 --- a/fe/fe-core/src/main/java/org/apache/doris/common/MarkDownParser.java +++ b/fe/fe-core/src/main/java/org/apache/doris/common/MarkDownParser.java @@ -17,31 +17,37 @@ package org.apache.doris.common; +import org.apache.doris.qe.HelpTopic; + import com.google.common.collect.Maps; import java.util.List; import java.util.Map; +import java.util.Set; -// Process markdown file. -// -// Example: -// file content is below: -// -// # head1 -// ## head2_1 -// some lines -// ## head2_2 -// some other lines -// -// will be parsed to map like {"head1" : {"head2_1":"some lines", "head2_2" : "some other lines"}} -// Note: It is allowed to have more than one topic in a file +/** + * A simple MarkDownParser to parser the help topic + * eg: sql-reference, sql-functions. + *

+ * Each topic must have following structure: + * ## Topic Name + * ### Description // required + * ### Example // optional + * ### Keywords // required + * other fields are optional + *

+ *

+ * It is allowed to have multi topic in one file. + */ public class MarkDownParser { - private static enum ParseState { + private enum ParseState { START, PARSED_H1, PARSED_H2 } + private static final byte SINGLE_POUND_SIGN = '#'; + private Map> documents; private List lines; private int nextToRead; @@ -68,7 +74,7 @@ public Map> parse() throws UserException { } switch (state) { case START: - if (headLevel == 1) { + if (headLevel == 2) { head = keyValue.getKey(); keyValues = Maps.newTreeMap(String.CASE_INSENSITIVE_ORDER); state = ParseState.PARSED_H1; @@ -78,12 +84,12 @@ public Map> parse() throws UserException { } break; case PARSED_H1: - if (headLevel == 1) { + if (headLevel == 2) { // Empty document, step over, do nothing documents.put(head, keyValues); head = keyValue.getKey(); keyValues = Maps.newTreeMap(String.CASE_INSENSITIVE_ORDER); - } else if (headLevel == 2) { + } else if (headLevel == 3) { keyValues.put(keyValue.getKey(), keyValue.getValue()); state = ParseState.PARSED_H2; } else { @@ -91,12 +97,12 @@ public Map> parse() throws UserException { } break; case PARSED_H2: - if (headLevel == 1) { + if (headLevel == 2) { // One document read over. documents.put(head, keyValues); head = keyValue.getKey(); keyValues = Maps.newTreeMap(String.CASE_INSENSITIVE_ORDER); - } else if (headLevel == 2) { + } else if (headLevel == 3) { keyValues.put(keyValue.getKey(), keyValue.getValue()); } else { //Ignore headlevel greater than 2 instead of throwing a exception @@ -113,34 +119,48 @@ public Map> parse() throws UserException { if (head != null) { documents.put(head, keyValues); } - + + checkStructure(); return documents; } + private void checkStructure() throws DdlException { + for (Map.Entry> entry : documents.entrySet()) { + Set keys = entry.getValue().keySet(); + if (!(keys.contains(HelpTopic.DESCRIPTION) + && keys.contains(HelpTopic.KEYWORDS))) { + throw new DdlException("Invalid help topic structure. title: " + entry.getKey() + ", keys: " + keys); + } + } + } + private Map.Entry parseOneItem() { - while (nextToRead < lines.size() && !lines.get(nextToRead).startsWith("#")) { + // 1. Find the first heading line (start with ##) + while (nextToRead < lines.size() && !lines.get(nextToRead).startsWith("##")) { nextToRead++; } if (nextToRead >= lines.size()) { return null; } + // 2. Get the level of this key String key = lines.get(nextToRead++); headLevel = 0; - while (headLevel < key.length() && key.charAt(headLevel) == '#') { + while (headLevel < key.length() && key.charAt(headLevel) == SINGLE_POUND_SIGN) { headLevel++; } + // 3. Save all lines within this level until we met next ## or ### StringBuilder sb = new StringBuilder(); while (nextToRead < lines.size()) { - if (!lines.get(nextToRead).startsWith("#")) { + if (!lines.get(nextToRead).startsWith("##")) { + // content sb.append(lines.get(nextToRead)).append('\n'); nextToRead++; - } - // Ignore headlevel greater than 2 - else if (lines.get(nextToRead).startsWith("###")) { - sb.append(lines.get(nextToRead).replaceAll("#","")).append('\n'); + } else if (lines.get(nextToRead).startsWith("####")) { + // Ignore head level greater than 3, treat them as normal content + sb.append(lines.get(nextToRead)).append('\n'); nextToRead++; - } - else { + } else { + // break if we meet next heading break; } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/httpv2/entity/ResponseBody.java b/fe/fe-core/src/main/java/org/apache/doris/httpv2/entity/ResponseBody.java index 74653b3e77699a..9738e7e4ae0570 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/httpv2/entity/ResponseBody.java +++ b/fe/fe-core/src/main/java/org/apache/doris/httpv2/entity/ResponseBody.java @@ -59,7 +59,6 @@ public ResponseBody data(T data) { return this; } - public String getMsg() { return msg; } diff --git a/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBDebugger.java b/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBDebugger.java index 2286c65417c62b..e4b4c78f29f012 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBDebugger.java +++ b/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBDebugger.java @@ -21,7 +21,6 @@ import org.apache.doris.common.FeMetaVersion; import org.apache.doris.common.ThreadPoolManager; import org.apache.doris.httpv2.HttpServer; -import org.apache.doris.httpv2.IllegalArgException; import org.apache.doris.journal.JournalEntity; import org.apache.doris.meta.MetaContext; import org.apache.doris.qe.QeService; @@ -46,7 +45,6 @@ import java.io.ByteArrayInputStream; import java.io.DataInputStream; import java.io.File; -import java.io.IOException; import java.util.List; /** @@ -84,7 +82,7 @@ public void startDebugMode(String dorisHomeDir) { } // Only start MySQL and HttpServer - private void startService(String dorisHomeDir) throws IllegalArgException, IOException { + private void startService(String dorisHomeDir) throws Exception { // HTTP server HttpServer httpServer = new HttpServer(); diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/HelpCategory.java b/fe/fe-core/src/main/java/org/apache/doris/qe/HelpCategory.java index 4f545ce652bdef..8da21de2e7b71b 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/HelpCategory.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/HelpCategory.java @@ -22,7 +22,6 @@ import java.util.Map; // HelpCategory is category of help information. -// This can public class HelpCategory implements HelpObjectIface { private static final String PARENT = "parent"; private static final String URL = "url"; diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/HelpModule.java b/fe/fe-core/src/main/java/org/apache/doris/qe/HelpModule.java index e90909008d4eb2..e774180ffdc859 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/HelpModule.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/HelpModule.java @@ -26,8 +26,8 @@ import com.google.common.collect.ImmutableSortedMap; import com.google.common.collect.Lists; -import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import java.io.BufferedReader; import java.io.File; @@ -97,7 +97,7 @@ public void setUpByZip(String path) throws IOException, UserException { ZipFile zf = new ZipFile(path); Enumeration entries = zf.entries(); while (entries.hasMoreElements()) { - ZipEntry entry = entries.nextElement(); + ZipEntry entry = entries.nextElement(); if (entry.isDirectory()) { setUpDirInZip(entry.getName()); } else { @@ -119,8 +119,13 @@ public void setUpByZip(String path) throws IOException, UserException { parentPathStr = pathObj.getParent().getFileName().toString(); } HelpObjectLoader topicLoader = HelpObjectLoader.createTopicLoader(); - List topics = topicLoader.loadAll(lines); - updateTopic(parentPathStr, topics); + try { + List topics = topicLoader.loadAll(lines); + updateTopic(parentPathStr, topics); + } catch (UserException e) { + LOG.warn("failed to load help topic: {}", entry.getName(), e); + throw e; + } } } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/HelpObjectLoader.java b/fe/fe-core/src/main/java/org/apache/doris/qe/HelpObjectLoader.java index 596bb27a5c31f1..dcf5933089f563 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/HelpObjectLoader.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/HelpObjectLoader.java @@ -17,13 +17,14 @@ package org.apache.doris.qe; -import org.apache.doris.common.UserException; import org.apache.doris.common.MarkDownParser; +import org.apache.doris.common.UserException; import com.google.common.base.Strings; import com.google.common.collect.Lists; -import org.apache.logging.log4j.Logger; + import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import java.io.IOException; import java.nio.charset.Charset; @@ -46,6 +47,7 @@ public List loadAll(List lines) throws UserException { List topics = Lists.newArrayList(); MarkDownParser parser = new MarkDownParser(lines); Map> docs = parser.parse(); + for (Map.Entry> doc : docs.entrySet()) { HelpTypeT topic = newInstance(); topic.loadFrom(doc); diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/HelpTopic.java b/fe/fe-core/src/main/java/org/apache/doris/qe/HelpTopic.java index ecbbf24cf60070..fa0c76b9a23038 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/HelpTopic.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/HelpTopic.java @@ -27,10 +27,11 @@ // Stolen from MySQL help_topic table. // Used to store one help topic. public class HelpTopic implements HelpObjectIface { - private static final String DESCRIPTION = "description"; - private static final String EXAMPLE = "example"; + public static final String DESCRIPTION = "description"; + public static final String EXAMPLE = "example"; + public static final String KEYWORDS = "keywords"; + private static final String URL = "url"; - private static final String KEYWORD = "keyword"; private static final String CATEGORY = "category"; private String name = ""; private String description = ""; @@ -86,7 +87,7 @@ public void loadFrom(Map.Entry> doc) { this.url = url; } // Keyword - String keyword = doc.getValue().get(KEYWORD); + String keyword = doc.getValue().get(KEYWORDS); if (!Strings.isNullOrEmpty(keyword)) { this.keywords = Lists.newArrayList(Splitter.onPattern(",").trimResults().omitEmptyStrings().split(keyword)); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/QeService.java b/fe/fe-core/src/main/java/org/apache/doris/qe/QeService.java index fd3153c73c439d..2be37ab9d264c0 100755 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/QeService.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/QeService.java @@ -19,11 +19,10 @@ import org.apache.doris.mysql.MysqlServer; import org.apache.doris.mysql.nio.NMysqlServer; + import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import java.io.IOException; - /** * This is the encapsulation of the entire front-end service, * including the creation of services that support the MySQL protocol @@ -41,12 +40,7 @@ public QeService(int port) { } public QeService(int port, boolean nioEnabled, ConnectScheduler scheduler) { - // Set up help module - try { - HelpModule.getInstance().setUpModule(); - } catch (Exception e) { - LOG.error("Help module failed, because:", e); - } + this.port = port; if (nioEnabled) { mysqlServer = new NMysqlServer(port, scheduler); @@ -55,7 +49,15 @@ public QeService(int port, boolean nioEnabled, ConnectScheduler scheduler) { } } - public void start() throws IOException { + public void start() throws Exception { + // Set up help module + try { + HelpModule.getInstance().setUpModule(); + } catch (Exception e) { + LOG.warn("Help module failed, because:", e); + throw e; + } + if (!mysqlServer.start()) { LOG.error("mysql server start failed"); System.exit(-1); diff --git a/fe/fe-core/src/test/resources/data/help/Admin/Select/help.md b/fe/fe-core/src/test/resources/data/help/Admin/Select/help.md index 6573a3b075adcf..d04273a93332c5 100644 --- a/fe/fe-core/src/test/resources/data/help/Admin/Select/help.md +++ b/fe/fe-core/src/test/resources/data/help/Admin/Select/help.md @@ -1,3 +1,4 @@ -#SELECT TIME -## keyword +##SELECT TIME +### description +### keywords SELECT diff --git a/fe/fe-core/src/test/resources/data/help/Admin/Show/help.md b/fe/fe-core/src/test/resources/data/help/Admin/Show/help.md index a0b6c32b4751ee..766cc0963dc90e 100644 --- a/fe/fe-core/src/test/resources/data/help/Admin/Show/help.md +++ b/fe/fe-core/src/test/resources/data/help/Admin/Show/help.md @@ -1,5 +1,6 @@ -#SHOW TABLES -## keyword +##SHOW TABLES +### description +### keywords SHOW, TABLE diff --git a/fe/fe-core/src/test/resources/data/helpCategoryNormal.md b/fe/fe-core/src/test/resources/data/helpCategoryNormal.md index 24c21d62b0a6f4..df6b0aed959f6b 100644 --- a/fe/fe-core/src/test/resources/data/helpCategoryNormal.md +++ b/fe/fe-core/src/test/resources/data/helpCategoryNormal.md @@ -1,5 +1,9 @@ -# Geographic +## Geographic +### description +### keywords -# Polygon properties -## parent +## Polygon properties +### description +### keywords +### parent Geographic Features diff --git a/fe/fe-core/src/test/resources/data/helpTopicNormal.md b/fe/fe-core/src/test/resources/data/helpTopicNormal.md index c0f3bb44439a51..a8663cd72e0088 100644 --- a/fe/fe-core/src/test/resources/data/helpTopicNormal.md +++ b/fe/fe-core/src/test/resources/data/helpTopicNormal.md @@ -1,22 +1,21 @@ This is data for unit test -# show tabLES -## description +## show tabLES +### description show table in this SYNTAX: SHOW TABLES -## example +### example show tables - -## url -## keyword +### url +### keywords SHOW, TABLES -## category +### category Administration -# SHOW DATABASES -## description +## SHOW DATABASES +### description show table in this SYNTAX: SHOW DATABASES -## keyword -SHOW, DATABASES \ No newline at end of file +### keywords +SHOW, DATABASES diff --git a/fe/fe-core/src/test/resources/data/show_help/functions/binary function/help.md b/fe/fe-core/src/test/resources/data/show_help/functions/binary function/help.md index 287b71bd72ba12..8f64a8eb6f85bf 100644 --- a/fe/fe-core/src/test/resources/data/show_help/functions/binary function/help.md +++ b/fe/fe-core/src/test/resources/data/show_help/functions/binary function/help.md @@ -1,11 +1,11 @@ # add ## description add function -## keyword +## keywords MATH # minus ## description minus function -## keyword +## keywords MATH diff --git a/fe/fe-core/src/test/resources/data/show_help/functions/bit function/help.md b/fe/fe-core/src/test/resources/data/show_help/functions/bit function/help.md index 5efb7a6fc03aa3..1cbeabf1bcfe1b 100644 --- a/fe/fe-core/src/test/resources/data/show_help/functions/bit function/help.md +++ b/fe/fe-core/src/test/resources/data/show_help/functions/bit function/help.md @@ -1,3 +1,3 @@ # or -## keyword +## keywords LOGICAL diff --git a/fe/fe-core/src/test/resources/test-help-resource-show-help.zip b/fe/fe-core/src/test/resources/test-help-resource-show-help.zip index 0dac062d1a8d8a..ed97cc09b9138d 100644 Binary files a/fe/fe-core/src/test/resources/test-help-resource-show-help.zip and b/fe/fe-core/src/test/resources/test-help-resource-show-help.zip differ diff --git a/fe/fe-core/src/test/resources/test-help-resource.zip b/fe/fe-core/src/test/resources/test-help-resource.zip index c47e06d6f8f917..549ffac69372a4 100644 Binary files a/fe/fe-core/src/test/resources/test-help-resource.zip and b/fe/fe-core/src/test/resources/test-help-resource.zip differ