This is an automated email from the ASF dual-hosted git repository.
luzhijing pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris-website.git
The following commit(s) were added to refs/heads/master by this push:
new 6def3bff43 [function] add overlay function doc (#761)
6def3bff43 is described below
commit 6def3bff43749a7c45ecf1aa7efb9f4e44e5d6c1
Author: koarz <[email protected]>
AuthorDate: Fri Jun 21 16:48:39 2024 +0800
[function] add overlay function doc (#761)
---
.../sql-functions/string-functions/overlay.md | 71 ++++++++++++++++++++++
.../sql-functions/string-functions/overlay.md | 71 ++++++++++++++++++++++
.../sql-functions/string-functions/overlay.md | 71 ++++++++++++++++++++++
sidebars.json | 1 +
.../sql-functions/string-functions/overlay.md | 71 ++++++++++++++++++++++
versioned_sidebars/version-2.1-sidebars.json | 1 +
6 files changed, 286 insertions(+)
diff --git a/docs/sql-manual/sql-functions/string-functions/overlay.md
b/docs/sql-manual/sql-functions/string-functions/overlay.md
new file mode 100644
index 0000000000..6490b2238b
--- /dev/null
+++ b/docs/sql-manual/sql-functions/string-functions/overlay.md
@@ -0,0 +1,71 @@
+---
+{
+ "title": "OVERLAY",
+ "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.
+-->
+
+## overlay
+### Description
+#### Syntax
+
+`VARCHAR Overlay (VARCHAR str, INT pos, INT len, VARCHAR newstr)`
+
+
+Returns the string str and replaces it with the string newstr, a substring of
len characters starting at position pos. If pos is not within the length of the
string, the original string is returned. If len is not within the length of the
rest of the string, the rest of the string is replaced starting at position
pos. If any argument is NULL, NULL is returned.
+
+### example
+
+```
+mysql> select overlay('Quadratic', 3, 4, 'What');
++------------------------------------+
+| overlay('Quadratic', 3, 4, 'What') |
++------------------------------------+
+| QuWhattic |
++------------------------------------+
+mysql> select overlay('Quadratic', -1, 4, 'What');
++-------------------------------------+
+| overlay('Quadratic', -1, 4, 'What') |
++-------------------------------------+
+| Quadratic |
++-------------------------------------+
+mysql> select overlay('Quadratic', 3, 100, 'What');
++--------------------------------------+
+| overlay('Quadratic', 3, 100, 'What') |
++--------------------------------------+
+| QuWhat |
++--------------------------------------+
+mysql> select overlay('Quadratic', 3, -1, 'What');
++-------------------------------------+
+| overlay('Quadratic', 3, -1, 'What') |
++-------------------------------------+
+| QuWhat |
++-------------------------------------+
+mysql> select overlay('Quadratic', 0, 100, 'What');
++--------------------------------------+
+| overlay('Quadratic', 0, 100, 'What') |
++--------------------------------------+
+| Quadratic |
++--------------------------------------+
+```
+### keywords
+ OVERLAY
\ No newline at end of file
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/string-functions/overlay.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/string-functions/overlay.md
new file mode 100644
index 0000000000..7ed8a57734
--- /dev/null
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/string-functions/overlay.md
@@ -0,0 +1,71 @@
+---
+{
+ "title": "OVERLAY",
+ "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.
+-->
+
+## overlay
+### Description
+#### Syntax
+
+`VARCHAR Overlay (VARCHAR str, INT pos, INT len, VARCHAR newstr)`
+
+
+返回字符串 str,并用字符串 newstr 替换从位置 pos 开始、长度为 len 字符的子字符串。如果 pos
不在字符串长度范围内,则返回原始字符串。如果 len 不在字符串其余部分的长度范围内,则从位置 pos 开始替换字符串其余部分。如果任何参数为
NULL,则返回 NULL。
+
+### example
+
+```
+mysql> select overlay('Quadratic', 3, 4, 'What');
++------------------------------------+
+| overlay('Quadratic', 3, 4, 'What') |
++------------------------------------+
+| QuWhattic |
++------------------------------------+
+mysql> select overlay('Quadratic', -1, 4, 'What');
++-------------------------------------+
+| overlay('Quadratic', -1, 4, 'What') |
++-------------------------------------+
+| Quadratic |
++-------------------------------------+
+mysql> select overlay('Quadratic', 3, 100, 'What');
++--------------------------------------+
+| overlay('Quadratic', 3, 100, 'What') |
++--------------------------------------+
+| QuWhat |
++--------------------------------------+
+mysql> select overlay('Quadratic', 3, -1, 'What');
++-------------------------------------+
+| overlay('Quadratic', 3, -1, 'What') |
++-------------------------------------+
+| QuWhat |
++-------------------------------------+
+mysql> select overlay('Quadratic', 0, 100, 'What');
++--------------------------------------+
+| overlay('Quadratic', 0, 100, 'What') |
++--------------------------------------+
+| Quadratic |
++--------------------------------------+
+```
+### keywords
+ OVERLAY
\ No newline at end of file
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/string-functions/overlay.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/string-functions/overlay.md
new file mode 100644
index 0000000000..7ed8a57734
--- /dev/null
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/string-functions/overlay.md
@@ -0,0 +1,71 @@
+---
+{
+ "title": "OVERLAY",
+ "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.
+-->
+
+## overlay
+### Description
+#### Syntax
+
+`VARCHAR Overlay (VARCHAR str, INT pos, INT len, VARCHAR newstr)`
+
+
+返回字符串 str,并用字符串 newstr 替换从位置 pos 开始、长度为 len 字符的子字符串。如果 pos
不在字符串长度范围内,则返回原始字符串。如果 len 不在字符串其余部分的长度范围内,则从位置 pos 开始替换字符串其余部分。如果任何参数为
NULL,则返回 NULL。
+
+### example
+
+```
+mysql> select overlay('Quadratic', 3, 4, 'What');
++------------------------------------+
+| overlay('Quadratic', 3, 4, 'What') |
++------------------------------------+
+| QuWhattic |
++------------------------------------+
+mysql> select overlay('Quadratic', -1, 4, 'What');
++-------------------------------------+
+| overlay('Quadratic', -1, 4, 'What') |
++-------------------------------------+
+| Quadratic |
++-------------------------------------+
+mysql> select overlay('Quadratic', 3, 100, 'What');
++--------------------------------------+
+| overlay('Quadratic', 3, 100, 'What') |
++--------------------------------------+
+| QuWhat |
++--------------------------------------+
+mysql> select overlay('Quadratic', 3, -1, 'What');
++-------------------------------------+
+| overlay('Quadratic', 3, -1, 'What') |
++-------------------------------------+
+| QuWhat |
++-------------------------------------+
+mysql> select overlay('Quadratic', 0, 100, 'What');
++--------------------------------------+
+| overlay('Quadratic', 0, 100, 'What') |
++--------------------------------------+
+| Quadratic |
++--------------------------------------+
+```
+### keywords
+ OVERLAY
\ No newline at end of file
diff --git a/sidebars.json b/sidebars.json
index 721f2ff735..8f010c55a4 100644
--- a/sidebars.json
+++ b/sidebars.json
@@ -728,6 +728,7 @@
"sql-manual/sql-functions/string-functions/elt",
"sql-manual/sql-functions/string-functions/instr",
"sql-manual/sql-functions/string-functions/locate",
+
"sql-manual/sql-functions/string-functions/overlay",
"sql-manual/sql-functions/string-functions/field",
"sql-manual/sql-functions/string-functions/find-in-set",
"sql-manual/sql-functions/string-functions/replace",
diff --git
a/versioned_docs/version-2.1/sql-manual/sql-functions/string-functions/overlay.md
b/versioned_docs/version-2.1/sql-manual/sql-functions/string-functions/overlay.md
new file mode 100644
index 0000000000..6490b2238b
--- /dev/null
+++
b/versioned_docs/version-2.1/sql-manual/sql-functions/string-functions/overlay.md
@@ -0,0 +1,71 @@
+---
+{
+ "title": "OVERLAY",
+ "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.
+-->
+
+## overlay
+### Description
+#### Syntax
+
+`VARCHAR Overlay (VARCHAR str, INT pos, INT len, VARCHAR newstr)`
+
+
+Returns the string str and replaces it with the string newstr, a substring of
len characters starting at position pos. If pos is not within the length of the
string, the original string is returned. If len is not within the length of the
rest of the string, the rest of the string is replaced starting at position
pos. If any argument is NULL, NULL is returned.
+
+### example
+
+```
+mysql> select overlay('Quadratic', 3, 4, 'What');
++------------------------------------+
+| overlay('Quadratic', 3, 4, 'What') |
++------------------------------------+
+| QuWhattic |
++------------------------------------+
+mysql> select overlay('Quadratic', -1, 4, 'What');
++-------------------------------------+
+| overlay('Quadratic', -1, 4, 'What') |
++-------------------------------------+
+| Quadratic |
++-------------------------------------+
+mysql> select overlay('Quadratic', 3, 100, 'What');
++--------------------------------------+
+| overlay('Quadratic', 3, 100, 'What') |
++--------------------------------------+
+| QuWhat |
++--------------------------------------+
+mysql> select overlay('Quadratic', 3, -1, 'What');
++-------------------------------------+
+| overlay('Quadratic', 3, -1, 'What') |
++-------------------------------------+
+| QuWhat |
++-------------------------------------+
+mysql> select overlay('Quadratic', 0, 100, 'What');
++--------------------------------------+
+| overlay('Quadratic', 0, 100, 'What') |
++--------------------------------------+
+| Quadratic |
++--------------------------------------+
+```
+### keywords
+ OVERLAY
\ No newline at end of file
diff --git a/versioned_sidebars/version-2.1-sidebars.json
b/versioned_sidebars/version-2.1-sidebars.json
index 1ba45d7587..998a235785 100644
--- a/versioned_sidebars/version-2.1-sidebars.json
+++ b/versioned_sidebars/version-2.1-sidebars.json
@@ -715,6 +715,7 @@
"sql-manual/sql-functions/string-functions/elt",
"sql-manual/sql-functions/string-functions/instr",
"sql-manual/sql-functions/string-functions/locate",
+
"sql-manual/sql-functions/string-functions/overlay",
"sql-manual/sql-functions/string-functions/field",
"sql-manual/sql-functions/string-functions/find-in-set",
"sql-manual/sql-functions/string-functions/replace",
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]