Skip to content
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

Closed
wants to merge 6 commits into from
Closed

Conversation

cool-joker
Copy link

@cool-joker cool-joker commented Jan 17, 2025

Versions

  • [✅ ] dev
  • 3.0
  • 2.1
  • 2.0

Languages

  • [✅ ] Chinese
  • English

Docs Checklist

  • Checked by AI
  • Test Cases Built

@cool-joker
Copy link
Author

http://39.106.86.136:8090/browse/DORIS-18163 string-function changes

Copy link
Contributor

@morrySnow morrySnow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

都是一些共性问题,每个评论了一个,麻烦所有函数文档都改一下吧

@@ -25,17 +25,19 @@ under the License.
-->


## trim-in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

删掉这行

## 描述

删除输入字符串两端的多余空格
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

描述有些问题,当存在第二个参数时,不是删除空格

## 语法

`VARCHAR trim_in(VARCHAR str[, VARCHAR rhs])`

## 注意事项

当没有 `rhs` 参数时,将参数 `str` 中右侧和左侧开始部分连续出现的空格去掉;当有 `rhs` 参数时,在字符串的两端查找并移除 `rhs` 字符集合中的任何字符(不考虑顺序)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这句话直接写到描述里面。去掉注意事项章节

## 描述

删除输入字符串两端的多余空格
## 语法

`VARCHAR trim_in(VARCHAR str[, VARCHAR rhs])`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

语法中不要有类型,参数需要尖括号包裹。使用code block 而不是 inline code。函数名使用大写

Suggested change
`VARCHAR trim_in(VARCHAR str[, VARCHAR rhs])`
```sql
TRIM_IN( <str> [, <rhs> ] )
```


当没有 `rhs` 参数时,将参数 `str` 中右侧和左侧开始部分连续出现的空格去掉;当有 `rhs` 参数时,在字符串的两端查找并移除 `rhs` 字符集合中的任何字符(不考虑顺序)


## 举例
## 示例

```sql
mysql> SELECT trim_in(' ab d ') str;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

去掉prompt

Suggested change
mysql> SELECT trim_in(' ab d ') str;
SELECT trim_in(' ab d ') str;

Comment on lines -48 to -52
mysql> SELECT trim_in('ababccaab','ab') str;
+------+
| str |
+------+
| cc |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个例子需要保留

+------------------------------------------------+
## 返回值
```sql
Doris+Q%26A
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

返回值使用mysql结果的table形式呈现

+------------------------------------------------+
| https://doris.apache.org/zh-CN/docs/sql-manual/sql-functions/string-functions |
+------------------------------------------------+
## 返回值
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

返回值章节不是写示例的返回值,而是写函数返回值的含义。应出现在示例上方

@cool-joker cool-joker requested a review from morrySnow January 17, 2025 14:28
@morrySnow
Copy link
Contributor

duplicates with #1851

@morrySnow morrySnow closed this Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants