Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"title": "ASCII",
"language": "en",
"description": "Returns the ASCII code value of the first character in a string. This function only processes the first character of the string,"
"description": "Returns the ASCII code value of the first character in a string. This function only processes the first character of the string, returning only the ASCII value of the first character for multi-character strings."
}
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"title": "AUTO_PARTITION_NAME",
"language": "en",
"description": "The AUTOPARTITIONNAME function is used to generate partition names for auto partitions."
"description": "The AUTO_PARTITION_NAME function is used to generate partition names for auto partitions. It supports two modes: RANGE mode generates partition names based on time units, and LIST mode generates partition names based on string values."
}
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"title": "CHAR_LENGTH",
"language": "en",
"description": "The CHARLENGTH function calculates the number of characters (not bytes) in a string. For multi-byte characters (such as Chinese characters),"
"description": "The CHAR_LENGTH function calculates the number of characters (not bytes) in a string. For multi-byte characters (such as Chinese characters), it returns the number of characters."
}
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ SELECT CHAR(68, 111, 114, 105, 115);
```
```text
+--------------------------------------+
| char('utf8', 68, 111, 114, 105, 115) |
| CHAR(68, 111, 114, 105, 115) |
+--------------------------------------+
| Doris |
+--------------------------------------+
Expand All @@ -54,7 +54,7 @@ SELECT CHAR(15049882, 15179199, 14989469);
```
```text
+--------------------------------------------+
| char('utf8', 15049882, 15179199, 14989469) |
| CHAR(15049882, 15179199, 14989469) |
+--------------------------------------------+
| 多睿丝 |
+--------------------------------------------+
Expand All @@ -66,7 +66,7 @@ SELECT CHAR(255);
```
```text
+-------------------+
| char('utf8', 255) |
| CHAR(255) |
+-------------------+
| NULL |
+-------------------+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"title": "COUNT_SUBSTRINGS",
"language": "en",
"description": "The COUNTSUBSTRINGS function counts the number of occurrences of a specified substring within a string."
"description": "The COUNT_SUBSTRINGS function counts the number of occurrences of a specified substring within a string."
}
---

Expand Down Expand Up @@ -121,7 +121,7 @@ SELECT count_substrings('éèêëìíîïðñòó éèêëìíîïðñòó', 'é
+------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+
```

7. Start position out of range
8. Multi-byte Chinese substring with start position
```sql
SELECT count_substrings('你好,世界!你好,世界!', '世界', 0),
count_substrings('你好,世界!你好,世界!', '世界', 30);
Expand All @@ -132,4 +132,4 @@ SELECT count_substrings('你好,世界!你好,世界!', '世界', 0),
+-----------------------------------------------------------------------+------------------------------------------------------------------------+
| 0 | 0 |
+-----------------------------------------------------------------------+------------------------------------------------------------------------+
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"title": "CUT_TO_FIRST_SIGNIFICANT_SUBDOMAIN",
"language": "en",
"description": "The CUTTOFIRSTSIGNIFICANTSUBDOMAIN function extracts the effective part of a domain from a URL,"
"description": "The CUT_TO_FIRST_SIGNIFICANT_SUBDOMAIN function extracts the effective part of a domain from a URL, including the top-level domain up to the first significant subdomain."
}
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"title": "FORMAT_NUMBER",
"language": "en",
"description": "The FORMATNUMBER function formats numerical values into strings with unit symbols. Supported units are: K (thousand), M (million), B (billion),"
"description": "The FORMAT_NUMBER function formats numerical values into strings with unit symbols. Supported units are: K (thousand), M (million), B (billion), T (trillion), Q (quadrillion)."
}
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
---
title: HAMMING_DISTANCE
{
"title": "HAMMING_DISTANCE",
"language": "en",
"description": "The HAMMING_DISTANCE function returns the number of positions at which two strings of equal length differ."
}
---

## Description
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"title": "LENGTH",
"language": "en",
"description": "The LENGTH function returns the byte length of a string (in bytes). This function calculates the number of bytes a string occupies in UTF-8 encoding,"
"description": "The LENGTH function returns the byte length of a string (in bytes). This function calculates the number of bytes a string occupies in UTF-8 encoding, not the number of characters."
}
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
---
title: LEVENSHTEIN
{
"title": "LEVENSHTEIN",
"language": "en",
"description": "The LEVENSHTEIN function returns the Levenshtein edit distance between two strings."
}
---

## Description
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"title": "MASK_LAST_N",
"language": "en",
"description": "The MASKLASTN function is used to mask the last N bytes of a string. It replaces uppercase letters with X, lowercase letters with x,"
"description": "The MASK_LAST_N function is used to mask the last N bytes of a string. It replaces uppercase letters with X, lowercase letters with x,"
}
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"title": "NGRAM_SEARCH",
"language": "en",
"description": "The NGRAMSEARCH function calculates the N-gram similarity between two strings. The similarity ranges from 0 to 1,"
"description": "The NGRAM_SEARCH function calculates the N-gram similarity between two strings. The similarity ranges from 0 to 1, where higher values indicate more similar strings."
}
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"title": "PARSE_DATA_SIZE",
"language": "en",
"description": "The PARSEDATASIZE function parses a string with storage units (such as \"1.5GB\") and converts it to a numeric value in bytes."
"description": "The PARSE_DATA_SIZE function parses a string with storage units (such as \"1.5GB\") and converts it to a numeric value in bytes."
}
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"title": "PARSE_URL",
"language": "en",
"description": "The PARSEURL function is mainly used to parse URL strings and extract various components from them, such as protocols, hosts, paths, query parameters,"
"description": "The PARSE_URL function is mainly used to parse URL strings and extract various components from them, such as protocols, hosts, paths, query parameters,"
}
---

Expand Down Expand Up @@ -56,6 +56,6 @@ SELECT parse_url ('https://doris.apache.org/', null);
+----------------------------------------------+
```

## 相关命令
## See Also

如果想获取 QUERY 中的特定 Parameter,可使用[extract_url_parameter](./extract-url-parameter.md)
If you want to extract a specific parameter from the QUERY, use [extract_url_parameter](./extract-url-parameter.md).
Original file line number Diff line number Diff line change
Expand Up @@ -164,45 +164,3 @@ SELECT POSITION('123' IN '456123789'), POSITION('-', 'phone: 123-456-7890', 11);
+------------------------------+-------------------------------------------+
```

## Description

The POSITION function is used to find the position of a substring within a string (counting from 1).

If the substring is not found, the function returns 0.

## Syntax

```sql
POSITION ( <substr> IN <str> )

POSITION ( <substr>, <str> [, <pos>] )
```

## Parameters

| Parameter | Description |
| --------- | ------------------------------------------------------------------------------------------ |
| `substr` | The substring to search for |
| `str` | The string to be searched |
| `pos` | If this parameter is specified, the position of substr is searched from the string starting with the pos subscript |

## Return value

The position of substr in str (counting from 1).
If substr is not found, returns 0.

```sql
SELECT POSITION('bar' IN 'foobarbar'),
POSITION('bar', 'foobarbar'),
POSITION('bar', 'foobarbar', 5),
POSITION('xbar', 'foobar');
```

```text

+----------------------------------+--------------------------------+-----------------------------------+----------------------------------+
| position('bar' in 'foobarbar') | position('bar', 'foobarbar') | position('bar', 'foobarbar', 5) | position('xbar', 'foobar') |
+----------------------------------+--------------------------------+-----------------------------------+----------------------------------+
| 4 | 4 | 7 | 0 |
+----------------------------------+--------------------------------+-----------------------------------+----------------------------------+
```
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ SELECT protocol(null);
+----------------+
```

## 相关命令
## See Also

If you want to extract other parts of the URL, you can use [parse_url](./parse-url.md)
If you want to extract other parts of the URL, you can use [parse_url](./parse-url.md).
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ Special cases:
- If input is NULL, returns the string 'NULL' (without quotes)
- Single quotes `'` are escaped to `\'`
- Backslashes `\` are escaped to `\\`
- `\\` is escaped to `\`
- Empty string returns `''`

## Examples
Expand All @@ -55,7 +54,7 @@ SELECT quote("It's a test");
+----------------------+
| quote("It's a test") |
+----------------------+
| 'It's a test' |
| 'It\'s a test' |
+----------------------+
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"title": "REGEXP_EXTRACT_ALL",
"language": "en",
"description": "The REGEXPEXTRACTALL function is used to perform a regular expression match on a given string str and extract all the parts that match the first sub "
"description": "The REGEXP_EXTRACT_ALL function is used to perform a regular expression match on a given string str and extract all the parts that match the first sub-pattern of the specified pattern."
}
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"title": "REGEXP_REPLACE_ONE",
"language": "en",
"description": "The REGEXPREPLACEONE function is a powerful tool designed to perform regular expression matching on a given string."
"description": "The REGEXP_REPLACE_ONE function is a powerful tool designed to perform regular expression matching on a given string."
}
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
---

## Description
~

Performs a regular expression match on the string str, returning true if the match succeeds, otherwise false. pattern is the regular expression pattern.
It should be noted that when handling character set matching, Utf-8 standard character classes should be used. This ensures that functions can correctly identify and process various characters from different languages.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,51 +161,3 @@ SELECT REPEAT('ṭṛìṭṛì', 3);
+--------------------------------------------------+
```

## Description

The REPEAT function is used to repeat a string a specified number of times.

## Syntax

```sql
REPEAT( <str>, <count> )
```

## Parameters

| Parameter | Description |
|-----------|---------------------------------------------------------------------------------------------------------------------------|
| `<str>` | The string to be repeated. |
| `<count>` | The number of times to repeat. It must be a non-negative integer. If it is less than 1, an empty string will be returned. |

## Return Value

Returns the string repeated the specified number of times. Special cases:

- If any Parameter is NULL, NULL will be returned.

## Examples

```sql
SELECT repeat("a", 3);
```

```text
+----------------+
| repeat('a', 3) |
+----------------+
| aaa |
+----------------+
```

```sql
SELECT repeat("a", -1);
```

```text
+-----------------+
| repeat('a', -1) |
+-----------------+
| |
+-----------------+
```
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"title": "REPLACE_EMPTY",
"language": "en",
"description": "The REPLACEEMPTY function is used to replace a part of characters in a string with other characters. Unlike the REPLACE function,"
"description": "The REPLACE_EMPTY function is used to replace a part of characters in a string with other characters. Unlike the REPLACE function,"
}
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,50 +156,3 @@ SELECT REVERSE('level'), REVERSE('12321');
+------------------+-------------------+
```

## Description

The REVERSE function is used to reverse the order of characters in a string or the order of elements in an array.

## Syntax

```sql
REVERSE( <seq> )
```

## Parameters

| Parameter | Description |
|-----------|----------------|
| `<seq>` | The string or array whose order needs to be reversed. |

## Return Value

Returns the string or array with the reversed order. Special cases:

- If any Parameter is NULL, NULL will be returned.

## Examples

```sql
SELECT reverse('hello');
```

```text
+------------------+
| REVERSE('hello') |
+------------------+
| olleh |
+------------------+
```

```sql
SELECT reverse(['hello', 'world']);
```

```text
+-----------------------------+
| reverse(['hello', 'world']) |
+-----------------------------+
| ["world", "hello"] |
+-----------------------------+
```
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"title": "SPLIT_BY_REGEXP/REGEXP_SPLIT_TO_ARRAY",
"language": "en",
"description": "The SPLITBYREGEXP function splits a string into an array of strings based on a specified regular expression pattern. Unlike SPLITBYSTRING,"
"description": "The SPLIT_BY_REGEXP function splits a string into an array of strings based on a specified regular expression pattern. Unlike SPLITBYSTRING,"
}
---

Expand Down
Loading
Loading