This is an automated email from the ASF dual-hosted git repository.
kassiez 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 be848b0324 [doc](function)support url domain functions (#1230)
be848b0324 is described below
commit be848b0324937152a1f61dc3d99d9d9116287cbe
Author: zhangstar333 <[email protected]>
AuthorDate: Tue Nov 19 10:16:49 2024 +0800
[doc](function)support url domain functions (#1230)
# Versions
- [x] dev
- [ ] 3.0
- [ ] 2.1
- [ ] 2.0
# Languages
- [x] Chinese
- [x] English
---------
Co-authored-by: KassieZ <[email protected]>
---
.../cut-to-first-significant-subdomain.md | 63 +++++++++++++++++++++
.../first-significant-subdomain.md | 64 ++++++++++++++++++++++
.../string-functions/top-level-domain.md | 64 ++++++++++++++++++++++
.../cut-to-first-significant-subdomain.md | 62 +++++++++++++++++++++
.../first-significant-subdomain.md | 63 +++++++++++++++++++++
.../string-functions/top-level-domain.md | 63 +++++++++++++++++++++
sidebars.json | 3 +
7 files changed, 382 insertions(+)
diff --git
a/docs/sql-manual/sql-functions/string-functions/cut-to-first-significant-subdomain.md
b/docs/sql-manual/sql-functions/string-functions/cut-to-first-significant-subdomain.md
new file mode 100644
index 0000000000..4f5e852eb7
--- /dev/null
+++
b/docs/sql-manual/sql-functions/string-functions/cut-to-first-significant-subdomain.md
@@ -0,0 +1,63 @@
+---
+{
+ "title": "CUT_TO_FIRST_SIGNIFICANT_SUBDOMAIN",
+ "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.
+-->
+
+
+## Description
+
+## Syntax
+
+`VARCHAR cut_to_first_significant_subdomain(VARCHAR url)`
+
+Extract the part of the domain in the URL from the top-level subdomain down to
the "first valid subdomain." If invalid, return an empty string.
+
+## Examples
+
+```sql
+mysql [(none)]>select cut_to_first_significant_subdomain("www.baidu.com");
++-----------------------------------------------------+
+| cut_to_first_significant_subdomain('www.baidu.com') |
++-----------------------------------------------------+
+| baidu.com |
++-----------------------------------------------------+
+
+mysql [(none)]>select cut_to_first_significant_subdomain("www.google.com.cn");
++---------------------------------------------------------+
+| cut_to_first_significant_subdomain('www.google.com.cn') |
++---------------------------------------------------------+
+| google.com.cn |
++---------------------------------------------------------+
+
+mysql [(none)]>select cut_to_first_significant_subdomain("wwwwwwww");
++------------------------------------------------+
+| cut_to_first_significant_subdomain('wwwwwwww') |
++------------------------------------------------+
+| |
++------------------------------------------------+
+```
+
+### Keywords
+
+CUT_TO_FIRST_SIGNIFICANT_SUBDOMAIN
diff --git
a/docs/sql-manual/sql-functions/string-functions/first-significant-subdomain.md
b/docs/sql-manual/sql-functions/string-functions/first-significant-subdomain.md
new file mode 100644
index 0000000000..8782796aae
--- /dev/null
+++
b/docs/sql-manual/sql-functions/string-functions/first-significant-subdomain.md
@@ -0,0 +1,64 @@
+---
+{
+ "title": "FIRST_SIGNIFICANT_SUBDOMAIN",
+ "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.
+-->
+
+
+## Description
+
+## Syntax
+
+`VARCHAR first_significant_subdomain(VARCHAR url)`
+
+
+Extract the "first valid subdomain" from a URL and return it. If the URL is
invalid, return an empty string.
+
+## Example
+
+```sql
+mysql [(none)]>select first_significant_subdomain("www.baidu.com");
++----------------------------------------------+
+| first_significant_subdomain('www.baidu.com') |
++----------------------------------------------+
+| baidu |
++----------------------------------------------+
+
+mysql [(none)]>select first_significant_subdomain("www.google.com.cn");
++--------------------------------------------------+
+| first_significant_subdomain('www.google.com.cn') |
++--------------------------------------------------+
+| google |
++--------------------------------------------------
+
+mysql [(none)]>select first_significant_subdomain("wwwwwwww");
++-----------------------------------------+
+| first_significant_subdomain('wwwwwwww') |
++-----------------------------------------+
+| |
++-----------------------------------------+
+```
+
+### Keywords
+
+FIRST_SIGNIFICANT_SUBDOMAIN
diff --git a/docs/sql-manual/sql-functions/string-functions/top-level-domain.md
b/docs/sql-manual/sql-functions/string-functions/top-level-domain.md
new file mode 100644
index 0000000000..a7a83a9067
--- /dev/null
+++ b/docs/sql-manual/sql-functions/string-functions/top-level-domain.md
@@ -0,0 +1,64 @@
+---
+{
+ "title": "TOP_LEVEL_DOMAIN",
+ "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.
+-->
+
+
+## Description
+
+## Syntax
+
+`VARCHAR top_level_domain(VARCHAR url)`
+
+
+Extract the top-level domain from a URL and return it. If the URL is invalid,
return an empty string.
+
+## Example
+
+```sql
+mysql [(none)]>select top_level_domain("www.baidu.com");
++-----------------------------------+
+| top_level_domain('www.baidu.com') |
++-----------------------------------+
+| com |
++-----------------------------------+
+
+mysql [(none)]>select top_level_domain("www.google.com.cn");
++---------------------------------------+
+| top_level_domain('www.google.com.cn') |
++---------------------------------------+
+| cn |
++---------------------------------------+
+
+mysql [(none)]>select top_level_domain("wwwwwwww");
++------------------------------+
+| top_level_domain('wwwwwwww') |
++------------------------------+
+| |
++------------------------------+
+```
+
+### keywords
+
+top_level_domain
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/string-functions/cut-to-first-significant-subdomain.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/string-functions/cut-to-first-significant-subdomain.md
new file mode 100644
index 0000000000..d97690d2d3
--- /dev/null
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/string-functions/cut-to-first-significant-subdomain.md
@@ -0,0 +1,62 @@
+---
+{
+ "title": "CUT_TO_FIRST_SIGNIFICANT_SUBDOMAIN",
+ "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.
+-->
+
+
+## 说明
+
+## 语法
+
+`VARCHAR cut_to_first_significant_subdomain(VARCHAR url)`
+
+在 URL 中提取出域中包含顶级子域直至“第一个有效子域”的部分, 若不合法时,则会返回空字符串
+
+```sql
+mysql [(none)]>select cut_to_first_significant_subdomain("www.baidu.com");
++-----------------------------------------------------+
+| cut_to_first_significant_subdomain('www.baidu.com') |
++-----------------------------------------------------+
+| baidu.com |
++-----------------------------------------------------+
+
+mysql [(none)]>select cut_to_first_significant_subdomain("www.google.com.cn");
++---------------------------------------------------------+
+| cut_to_first_significant_subdomain('www.google.com.cn') |
++---------------------------------------------------------+
+| google.com.cn |
++---------------------------------------------------------+
+
+mysql [(none)]>select cut_to_first_significant_subdomain("wwwwwwww");
++------------------------------------------------+
+| cut_to_first_significant_subdomain('wwwwwwww') |
++------------------------------------------------+
+| |
++------------------------------------------------+
+
+```
+
+## 关键词
+
+CUT_TO_FIRST_SIGNIFICANT_SUBDOMAIN
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/string-functions/first-significant-subdomain.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/string-functions/first-significant-subdomain.md
new file mode 100644
index 0000000000..7d9783c1a3
--- /dev/null
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/string-functions/first-significant-subdomain.md
@@ -0,0 +1,63 @@
+---
+{
+ "title": "FIRST_SIGNIFICANT_SUBDOMAIN",
+ "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.
+-->
+
+
+## 描述
+
+## 语法
+
+`VARCHAR first_significant_subdomain(VARCHAR url)`
+
+
+在 URL 中提取出“第一个有效子域”返回,若不合法则会返回空字符串
+
+```
+mysql [(none)]>select first_significant_subdomain("www.baidu.com");
++----------------------------------------------+
+| first_significant_subdomain('www.baidu.com') |
++----------------------------------------------+
+| baidu |
++----------------------------------------------+
+
+mysql [(none)]>select first_significant_subdomain("www.google.com.cn");
++--------------------------------------------------+
+| first_significant_subdomain('www.google.com.cn') |
++--------------------------------------------------+
+| google |
++--------------------------------------------------
+
+mysql [(none)]>select first_significant_subdomain("wwwwwwww");
++-----------------------------------------+
+| first_significant_subdomain('wwwwwwww') |
++-----------------------------------------+
+| |
++-----------------------------------------+
+
+```
+
+## 关键词
+
+FIRST_SIGNIFICANT_SUBDOMAIN
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/string-functions/top-level-domain.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/string-functions/top-level-domain.md
new file mode 100644
index 0000000000..eca889df51
--- /dev/null
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/string-functions/top-level-domain.md
@@ -0,0 +1,63 @@
+---
+{
+ "title": "TOP_LEVEL_DOMAIN",
+ "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.
+-->
+
+
+## 描述
+
+## 语法
+
+`VARCHAR top_level_domain(VARCHAR url)`
+
+
+在 URL 中提取出顶级域名返回,若为不合法的 URL,则返回空字符串
+
+```sql
+mysql [(none)]>select top_level_domain("www.baidu.com");
++-----------------------------------+
+| top_level_domain('www.baidu.com') |
++-----------------------------------+
+| com |
++-----------------------------------+
+
+mysql [(none)]>select top_level_domain("www.google.com.cn");
++---------------------------------------+
+| top_level_domain('www.google.com.cn') |
++---------------------------------------+
+| cn |
++---------------------------------------+
+
+mysql [(none)]>select top_level_domain("wwwwwwww");
++------------------------------+
+| top_level_domain('wwwwwwww') |
++------------------------------+
+| |
++------------------------------+
+
+```
+
+### 关键词
+
+TOP_LEVEL_DOMAIN
diff --git a/sidebars.json b/sidebars.json
index f6e554bfad..7813b8387c 100644
--- a/sidebars.json
+++ b/sidebars.json
@@ -956,6 +956,9 @@
"sql-manual/sql-functions/string-functions/money-format",
"sql-manual/sql-functions/string-functions/ngram-search",
"sql-manual/sql-functions/string-functions/parse-url",
+
"sql-manual/sql-functions/string-functions/cut-to-first-significant-subdomain",
+
"sql-manual/sql-functions/string-functions/first-significant-subdomain",
+
"sql-manual/sql-functions/string-functions/top-level-domain",
"sql-manual/sql-functions/string-functions/quote",
"sql-manual/sql-functions/string-functions/url-decode",
"sql-manual/sql-functions/string-functions/convert-to",
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]