Skip to content

update docs for string functions multi-match-any, multi-search-all-positions, ngram-search and tokenize#1948

Open
xiaokang wants to merge 2 commits intoapache:masterfrom
xiaokang:update_string_functions
Open

update docs for string functions multi-match-any, multi-search-all-positions, ngram-search and tokenize#1948
xiaokang wants to merge 2 commits intoapache:masterfrom
xiaokang:update_string_functions

Conversation

@xiaokang
Copy link
Contributor

Versions

  • dev
  • 3.0
  • 2.1
  • 2.0

Languages

  • Chinese
  • English

Docs Checklist

  • Checked by AI
  • Test Cases Built

multi-search-all-positions, ngram-search and tokenize
multi-search-all-positions, ngram-search and tokenize
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.

只评论了第一个文件,麻烦都改一下


Checks whether the string `haystack` matches the regular expressions `patterns` in re2 syntax. returns 0 if none of the regular expressions are matched and 1 if any of the patterns matches.
```sql
TINYINT multi_match_any(VARCHAR haystack, ARRAY<VARCHAR> patterns)
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. 不用参数类型和返回类型
  2. 函数名大写
  3. 参数需要尖括号包裹
Suggested change
TINYINT multi_match_any(VARCHAR haystack, ARRAY<VARCHAR> patterns)
MULTI_MATCH_ANY(<haystack>, <patterns>)

Comment on lines +41 to +42
| `haystack` | The string to be checked |
| `patterns` | Array of regular expressions |
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
| `haystack` | The string to be checked |
| `patterns` | Array of regular expressions |
| `<haystack>` | The string to be checked |
| `<patterns>` | Array of regular expressions |


## Return Value

Returns 1 if the string `haystack` matches any of the regular expressions in the `patterns` array, otherwise returns 0.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Returns 1 if the string `haystack` matches any of the regular expressions in the `patterns` array, otherwise returns 0.
Returns 1 if the string `<haystack>` matches any of the regular expressions in the `<patterns>` array, otherwise returns 0.

## Examples

```sql
mysql> SELECT multi_match_any('Hello, World!', ['hello', '!', 'world']);
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 multi_match_any('Hello, World!', ['hello', '!', 'world']);
SELECT multi_match_any('Hello, World!', ['hello', '!', 'world']);

Comment on lines 52 to 56
+-----------------------------------------------------------+
| multi_match_any('Hello, World!', ['hello', '!', 'world']) |
+-----------------------------------------------------------+
| 1 |
+-----------------------------------------------------------+
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 中,结果使用 text 格式

```text
+-----------------------------------------------------------+
| multi_match_any('Hello, World!', ['hello', '!', 'world']) |
+-----------------------------------------------------------+
| 1                                                         |
+-----------------------------------------------------------+
```

@KassieZ KassieZ added has comments Some comments not resolved yet and removed request review labels Feb 7, 2025
@xiaokang xiaokang requested a review from zclllyybb as a code owner March 19, 2026 12:54
@xiaokang xiaokang force-pushed the update_string_functions branch from f32d932 to abaa78e Compare March 19, 2026 13:21
@xiaokang xiaokang force-pushed the update_string_functions branch 2 times, most recently from 087102c to c16141e Compare March 19, 2026 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

has comments Some comments not resolved yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants