diff options
| author | vvvv <[email protected]> | 2025-10-20 14:28:48 +0300 |
|---|---|---|
| committer | vvvv <[email protected]> | 2025-10-20 15:33:32 +0300 |
| commit | 54f11197f61e07f384ee69be4345de116df10864 (patch) | |
| tree | b441ea515352ea31f01ca511e7e3a003cd52e6c5 /yql/essentials/docs | |
| parent | c12bf4cfcead3a0172e4a140d0c89bbe18ee1791 (diff) | |
YQL-20520 concat (w/o runtime)
commit_hash:0b092481cfb4813c26c165c17f6d05a9f1f88481
Diffstat (limited to 'yql/essentials/docs')
| -rw-r--r-- | yql/essentials/docs/en/builtins/basic.md | 20 | ||||
| -rw-r--r-- | yql/essentials/docs/en/changelog/2025.04.md | 1 | ||||
| -rw-r--r-- | yql/essentials/docs/en/syntax/expressions.md | 2 | ||||
| -rw-r--r-- | yql/essentials/docs/ru/builtins/basic.md | 20 | ||||
| -rw-r--r-- | yql/essentials/docs/ru/changelog/2025.04.md | 1 | ||||
| -rw-r--r-- | yql/essentials/docs/ru/syntax/expressions.md | 2 |
6 files changed, 46 insertions, 0 deletions
diff --git a/yql/essentials/docs/en/builtins/basic.md b/yql/essentials/docs/en/builtins/basic.md index 994387eaf57..7619c7e9b7f 100644 --- a/yql/essentials/docs/en/builtins/basic.md +++ b/yql/essentials/docs/en/builtins/basic.md @@ -90,6 +90,26 @@ SELECT SUBSTRING("abcdefg", 3); -- defg SELECT SUBSTRING("abcdefg", NULL, 3); -- abc ``` +## Concat {#concat} + +Concatenate one or more strings. + +#### Signature + +```yql +Concat((String|Utf8)[?], ...)->(String|Utf8)[?] +``` + +This function is available since version [2025.04](../changelog/2025.04.md). +If at least one input string is of type `Optional`, then the result is also of type `Optional`. +If all input strings are of type `Utf8`, then the result is also of type `Utf8`; otherwise, it is `String`. +If at least one input string is `NULL`, then the result is also of type `NULL`. + +#### Examples + +```yql +SELECT Concat("abc", "de", "f"); -- "abcdef" +``` ## FIND {#find} diff --git a/yql/essentials/docs/en/changelog/2025.04.md b/yql/essentials/docs/en/changelog/2025.04.md index f6e20c7092d..42652f7a3bf 100644 --- a/yql/essentials/docs/en/changelog/2025.04.md +++ b/yql/essentials/docs/en/changelog/2025.04.md @@ -11,6 +11,7 @@ Added linear types. * Added `ToDynamicLinear`/`FromDynamicLinear` functions for converting between linear types. * Added `LinearType`/`DynamicLinearType` functions for constructing linear types. * Added the `LinearTypeHandle`/`DynamicLinearTypeHandle` functions for constructing linear types during code generation. * Added the `LinearItemType` function for retrieving the parameter type from a linear type. +* Added `Concat` function for string concatenation. ## Changes in NOT NULL expression diff --git a/yql/essentials/docs/en/syntax/expressions.md b/yql/essentials/docs/en/syntax/expressions.md index 7d6ceceb9fd..cc8f9bdeb82 100644 --- a/yql/essentials/docs/en/syntax/expressions.md +++ b/yql/essentials/docs/en/syntax/expressions.md @@ -10,6 +10,8 @@ As with other binary operators, if the data on either side is `NULL`, the result Don't confuse this operator with a logical "or": in SQL, it's denoted by the `OR` keyword. It's also not worth doing concatenation using `+`. +There is a similar function for this operator [Concat](../builtins/basic.md#concat), which supports an arbitrary number of arguments. + #### Examples ```yql diff --git a/yql/essentials/docs/ru/builtins/basic.md b/yql/essentials/docs/ru/builtins/basic.md index 5286146d226..ff56f6d994e 100644 --- a/yql/essentials/docs/ru/builtins/basic.md +++ b/yql/essentials/docs/ru/builtins/basic.md @@ -109,6 +109,26 @@ SELECT SUBSTRING("abcdefg", 3); -- defg SELECT SUBSTRING("abcdefg", NULL, 3); -- abc ``` +## Concat {#concat} + +Конкатенация одной и более строк. + +#### Сигнатура + +```yql +Concat((String|Utf8)[?], ...)->(String|Utf8)[?] +``` + +Функция доступна начиная с версии [2025.04](../changelog/2025.04.md). +Если хотя бы у одной входной строки тип `Optional`, то таким же является и результат. +Если все входные строки имеют тип `Utf8`, то таким же является и результат, в противном случае - `String`. +Если хотя бы одна входная строка является `NULL`, то таким же является и результат. + +#### Примеры + +```yql +SELECT Concat("abc", "de", "f"); -- "abcdef" +``` ## FIND {#find} diff --git a/yql/essentials/docs/ru/changelog/2025.04.md b/yql/essentials/docs/ru/changelog/2025.04.md index 49cf7e82b2c..813940dd483 100644 --- a/yql/essentials/docs/ru/changelog/2025.04.md +++ b/yql/essentials/docs/ru/changelog/2025.04.md @@ -12,6 +12,7 @@ * Добавлены функции `LinearType`/`DynamicLinearType` для построения линейных типов. * Добавлены функции `LinearTypeHandle`/`DynamicLinearTypeHandle` для построения линейных типов во время кодогенерации. * Добавлена функция `LinearItemType` для получения типа параметра из линейного типа. +* Добавлена функция `Concat` для конкатенации строк. ## Изменения в выражении NOT NULL diff --git a/yql/essentials/docs/ru/syntax/expressions.md b/yql/essentials/docs/ru/syntax/expressions.md index 89687484760..c7825fc340c 100644 --- a/yql/essentials/docs/ru/syntax/expressions.md +++ b/yql/essentials/docs/ru/syntax/expressions.md @@ -10,6 +10,8 @@ Не следует путать этот оператор с логическим «или», в SQL оно обозначается ключевым словом `OR`. Также не стоит пытаться делать конкатенацию через `+`. +Для этого оператора есть аналогичная функция [Concat](../builtins/basic.md#concat), которая поддерживает произвольное число аргументов. + #### Примеры ```yql |
