-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
string-function changes #1841
string-function changes #1841
Changes from all commits
6addad7
3447133
f9d4c68
595ea34
0965456
bc29d61
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -25,17 +25,19 @@ under the License. | |||||||||
--> | ||||||||||
|
||||||||||
|
||||||||||
## trim-in | ||||||||||
## 描述 | ||||||||||
|
||||||||||
删除输入字符串两端的多余空格 | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 描述有些问题,当存在第二个参数时,不是删除空格 |
||||||||||
## 语法 | ||||||||||
|
||||||||||
`VARCHAR trim_in(VARCHAR str[, VARCHAR rhs])` | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 语法中不要有类型,参数需要尖括号包裹。使用code block 而不是 inline code。函数名使用大写
Suggested change
|
||||||||||
|
||||||||||
## 注意事项 | ||||||||||
|
||||||||||
当没有 `rhs` 参数时,将参数 `str` 中右侧和左侧开始部分连续出现的空格去掉;当有 `rhs` 参数时,在字符串的两端查找并移除 `rhs` 字符集合中的任何字符(不考虑顺序) | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这句话直接写到描述里面。去掉注意事项章节 |
||||||||||
|
||||||||||
|
||||||||||
## 举例 | ||||||||||
## 示例 | ||||||||||
|
||||||||||
```sql | ||||||||||
mysql> SELECT trim_in(' ab d ') str; | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 去掉prompt
Suggested change
|
||||||||||
|
@@ -44,15 +46,4 @@ mysql> SELECT trim_in(' ab d ') str; | |||||||||
+------+ | ||||||||||
| ab d | | ||||||||||
+------+ | ||||||||||
|
||||||||||
mysql> SELECT trim_in('ababccaab','ab') str; | ||||||||||
+------+ | ||||||||||
| str | | ||||||||||
+------+ | ||||||||||
| cc | | ||||||||||
Comment on lines
-48
to
-52
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个例子需要保留 |
||||||||||
+------+ | ||||||||||
``` | ||||||||||
|
||||||||||
## 关键词 | ||||||||||
|
||||||||||
TRIM_IN | ||||||||||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,53 @@ | ||
--- | ||
{ | ||
"title": "URL_ENCODE", | ||
"title": "url_decode", | ||
"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. | ||
--> | ||
|
||
|
||
## 描述 | ||
|
||
使用 UTF-8 编码完成所提供文本的 URL 编码。通常用于对作为 URL 的一部分传递的参数信息进行编码 | ||
|
||
## 语法 | ||
|
||
```sql | ||
URL_ENCODE(' STRING ') | ||
``` | ||
|
||
## 必选参数 | ||
|
||
- STRING: 待编码的字符串。 | ||
|
||
## 示例 | ||
|
||
```sql | ||
mysql> select URL_ENCODE('Doris Q&A'); | ||
+-------------------------+ | ||
| url_encode('Doris Q&A') | | ||
+-------------------------+ | ||
| Doris+Q%26A | | ||
+-------------------------+ | ||
|
||
``` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
{ | ||
"title": "UCASE", | ||
"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. | ||
--> | ||
|
||
|
||
## 描述 | ||
|
||
用于将字符串转换为大写字母 | ||
|
||
## 别名 | ||
|
||
- upper | ||
|
||
## 语法 | ||
|
||
```sql | ||
ucase( str ) | ||
``` | ||
|
||
### 示例 | ||
|
||
```sql | ||
mysql> SELECT ucase("aBc123"); | ||
+-----------------+ | ||
| ucase('aBc123') | | ||
+-----------------+ | ||
| ABC123 | | ||
+-----------------+ | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
{ | ||
"title": "url_decode", | ||
"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. | ||
--> | ||
|
||
|
||
## 描述 | ||
|
||
将URL转换为解码字符串。 | ||
|
||
## 语法 | ||
|
||
```sql | ||
url_decode( url ) | ||
``` | ||
|
||
## 必选参数 | ||
|
||
- url: 待解码的url。 | ||
|
||
## 示例 | ||
|
||
```sql | ||
mysql> select url_decode('https%3A%2F%2Fdoris.apache.org%2Fzh-CN%2Fdocs%2Fsql-manual%2Fsql-functions%2Fstring-functions'); | ||
+------------------------------------------------+ | ||
| url_decode('https%3A%2F%2Fdoris.apache.org%2Fzh-CN%2Fdocs%2Fsql-manual%2Fsql-functions%2Fstring-functions') | | ||
+------------------------------------------------+ | ||
| https://doris.apache.org/zh-CN/docs/sql-manual/sql-functions/string-functions | | ||
+------------------------------------------------+ | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
删掉这行