This is an automated email from the ASF dual-hosted git repository.

morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 181f1cf176 [Docs](function) add some missing function docs (#14510)
181f1cf176 is described below

commit 181f1cf17633277cf3078859f1a40f4584ce7ea1
Author: zhangstar333 <87313068+zhangstar...@users.noreply.github.com>
AuthorDate: Wed Nov 23 21:39:17 2022 +0800

    [Docs](function) add some missing function docs (#14510)
---
 .../sql-functions/string-functions/esquery.md      | 73 +++++++++++++++++++++
 .../sql-functions/string-functions/sleep.md        | 48 ++++++++++++++
 .../sql-functions/string-functions/space.md        | 55 ++++++++++++++++
 docs/sidebars.json                                 |  3 +
 .../sql-functions/string-functions/esquery.md      | 74 ++++++++++++++++++++++
 .../sql-functions/string-functions/sleep.md        | 48 ++++++++++++++
 .../sql-functions/string-functions/space.md        | 55 ++++++++++++++++
 7 files changed, 356 insertions(+)

diff --git a/docs/en/docs/sql-manual/sql-functions/string-functions/esquery.md 
b/docs/en/docs/sql-manual/sql-functions/string-functions/esquery.md
new file mode 100644
index 0000000000..279de22991
--- /dev/null
+++ b/docs/en/docs/sql-manual/sql-functions/string-functions/esquery.md
@@ -0,0 +1,73 @@
+---
+{
+    "title": "esquery",
+    "language": "en"
+}
+---
+
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+## esquery
+### description
+#### Syntax
+
+`boolean esquery(varchar field, varchar QueryDSL)`
+
+Use the esquery (field, QueryDSL) function to match queries that cannot be 
expressed in SQL are pushed down to Elasticsearch for filtering. 
+The first column name parameter of esquery is used to associate indexes, and 
the second parameter is the json expression of the basic query DSL of ES, which 
is contained in curly brackets {}. There is one and only one root key of json, 
such as match_phrase、geo_Shape, bool.
+
+### example
+
+```
+match_phrase SQL:
+
+select * from es_table where esquery(k4, '{
+        "match_phrase": {
+           "k4": "doris on es"
+        }
+    }');
+
+
+geo SQL:
+
+select * from es_table where esquery(k4, '{
+      "geo_shape": {
+         "location": {
+            "shape": {
+               "type": "envelope",
+               "coordinates": [
+                  [
+                     13,
+                     53
+                  ],
+                  [
+                     14,
+                     52
+                  ]
+               ]
+            },
+            "relation": "within"
+         }
+      }
+   }');
+```
+
+### keywords
+    esquery
diff --git a/docs/en/docs/sql-manual/sql-functions/string-functions/sleep.md 
b/docs/en/docs/sql-manual/sql-functions/string-functions/sleep.md
new file mode 100644
index 0000000000..3973249548
--- /dev/null
+++ b/docs/en/docs/sql-manual/sql-functions/string-functions/sleep.md
@@ -0,0 +1,48 @@
+---
+{
+    "title": "sleep",
+    "language": "en"
+}
+---
+
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+## sleep
+### Description
+#### Syntax
+
+`boolean sleep (int num)`
+
+Make the thread sleep for num seconds.
+
+### example
+
+```
+mysql> select sleep(10);
++-----------+
+| sleep(10) |
++-----------+
+|         1 |
++-----------+
+1 row in set (10.01 sec)
+
+```
+### keywords
+    sleep
diff --git a/docs/en/docs/sql-manual/sql-functions/string-functions/space.md 
b/docs/en/docs/sql-manual/sql-functions/string-functions/space.md
new file mode 100644
index 0000000000..49b3ab0f39
--- /dev/null
+++ b/docs/en/docs/sql-manual/sql-functions/string-functions/space.md
@@ -0,0 +1,55 @@
+---
+{
+    "title": "space",
+    "language": "en"
+}
+---
+
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+## space
+### Description
+#### Syntax
+
+`VARCHAR space(Int num)`
+
+Returns a string consisting of num spaces.
+
+### example
+
+```
+mysql> select length(space(10));
++-------------------+
+| length(space(10)) |
++-------------------+
+|                10 |
++-------------------+
+1 row in set (0.01 sec)
+
+mysql> select length(space(-10));
++--------------------+
+| length(space(-10)) |
++--------------------+
+|                  0 |
++--------------------+
+1 row in set (0.02 sec)
+```
+### keywords
+    space
diff --git a/docs/sidebars.json b/docs/sidebars.json
index 42dae17227..16096c8a40 100644
--- a/docs/sidebars.json
+++ b/docs/sidebars.json
@@ -403,6 +403,9 @@
                                 
"sql-manual/sql-functions/string-functions/parse_url",
                                 
"sql-manual/sql-functions/string-functions/extract_url_parameter",
                                 
"sql-manual/sql-functions/string-functions/uuid",
+                                
"sql-manual/sql-functions/string-functions/space",
+                                
"sql-manual/sql-functions/string-functions/sleep",
+                                
"sql-manual/sql-functions/string-functions/esquery",
                                 
"sql-manual/sql-functions/string-functions/mask/mask",
                                 
"sql-manual/sql-functions/string-functions/mask/mask_first_n",
                                 
"sql-manual/sql-functions/string-functions/mask/mask_last_n",
diff --git 
a/docs/zh-CN/docs/sql-manual/sql-functions/string-functions/esquery.md 
b/docs/zh-CN/docs/sql-manual/sql-functions/string-functions/esquery.md
new file mode 100644
index 0000000000..ec4fdf7e1b
--- /dev/null
+++ b/docs/zh-CN/docs/sql-manual/sql-functions/string-functions/esquery.md
@@ -0,0 +1,74 @@
+---
+{
+    "title": "esquery",
+    "language": "zh-CN"
+}
+---
+
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+## esquery
+### description
+#### Syntax
+
+`boolean esquery(varchar field, varchar QueryDSL)`
+
+通过esquery(field, 
QueryDSL)函数将一些无法用sql表述的query如match_phrase、geoshape等下推给Elasticsearch进行过滤处理.
+esquery的第一个列名参数用于关联index,第二个参数是ES的基本Query DSL的json表述,使用花括号{}包含,json的root 
key有且只能有一个,
+如match_phrase、geo_shape、bool等
+
+### example
+
+```
+match_phrase查询:
+
+select * from es_table where esquery(k4, '{
+        "match_phrase": {
+           "k4": "doris on es"
+        }
+    }');
+
+
+geo相关查询:
+
+select * from es_table where esquery(k4, '{
+      "geo_shape": {
+         "location": {
+            "shape": {
+               "type": "envelope",
+               "coordinates": [
+                  [
+                     13,
+                     53
+                  ],
+                  [
+                     14,
+                     52
+                  ]
+               ]
+            },
+            "relation": "within"
+         }
+      }
+   }');
+```
+
+### keywords
+    esquery
diff --git a/docs/zh-CN/docs/sql-manual/sql-functions/string-functions/sleep.md 
b/docs/zh-CN/docs/sql-manual/sql-functions/string-functions/sleep.md
new file mode 100644
index 0000000000..9aac296c79
--- /dev/null
+++ b/docs/zh-CN/docs/sql-manual/sql-functions/string-functions/sleep.md
@@ -0,0 +1,48 @@
+---
+{
+    "title": "sleep",
+    "language": "zh-CN"
+}
+---
+
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+## sleep
+### description
+#### Syntax
+
+`boolean sleep(Int num)`
+
+使该线程休眠num秒。
+
+### example
+
+```
+mysql> select sleep(10);
++-----------+
+| sleep(10) |
++-----------+
+|         1 |
++-----------+
+1 row in set (10.01 sec)
+
+```
+### keywords
+    sleep
diff --git a/docs/zh-CN/docs/sql-manual/sql-functions/string-functions/space.md 
b/docs/zh-CN/docs/sql-manual/sql-functions/string-functions/space.md
new file mode 100644
index 0000000000..4ca7fe6958
--- /dev/null
+++ b/docs/zh-CN/docs/sql-manual/sql-functions/string-functions/space.md
@@ -0,0 +1,55 @@
+---
+{
+    "title": "space",
+    "language": "zh-CN"
+}
+---
+
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+## space
+### description
+#### Syntax
+
+`VARCHAR space(Int num)`
+
+返回由num个空格组成的字符串。
+
+### example
+
+```
+mysql> select length(space(10));
++-------------------+
+| length(space(10)) |
++-------------------+
+|                10 |
++-------------------+
+1 row in set (0.01 sec)
+
+mysql> select length(space(-10));
++--------------------+
+| length(space(-10)) |
++--------------------+
+|                  0 |
++--------------------+
+1 row in set (0.02 sec)
+```
+### keywords
+    space


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to