Funkcje ogólne

Funkcje ogólne

Nazwa Opis
CONCAT Łączy co najmniej 2 wartości tego samego typu.
LENGTH Oblicza długość String, Bytes, Array, Vector lub Map.
REVERSE Cofa działanie String, Bytes lub Array.

Przykłady klientów

Node.js
concat(constant("Author ID: "), field("authorId"));

Web

concat(constant("Author ID: "), field("authorId"));
Swift
let displayString = Constant("Author ID: ").concat([Field("authorId")])

Kotlin

val displayString = constant("Author ID: ").concat(field("authorId"))

Java

Expression displayString = constant("Author ID: ").concat(field("authorId"));
Python
Constant.of("Author ID: ").concat(Field.of("authorId"))

CONCAT

Składnia:

concat[T <: STRING | BYTES | ARRAY](values:T ...) -> T

Opis:

Łączy co najmniej 2 wartości tego samego typu.

Przykłady:

wartości concat(values)
„abc”, „def” „abcdef”
[1, 2], [3, 4] [1, 2, 3, 4]
b"abc", b"def" b"abcdef"
„abc”, [1,2,3], „ghi” błąd
[1,2,3] błąd
"abc", null null

LENGTH

Składnia:

length[T <: STRING | BYTES | ARRAY | VECTOR | MAP](value: T) -> INT64

Opis:

Oblicza długość wartości String, Bytes, Array, Vector lub Map.

Przykłady:

wartość length(value)
„Witaj” 5
[1, 2, 3, 4] 4
b"abcde" 5
null null
1 błąd

ODWRÓĆ

Składnia:

reverse[T <: STRING | BYTES | ARRAY](value: T) -> T

Opis:

Odwraca wartość String, Bytes lub Array.

Przykłady:

wartość reverse(value)
„Witaj” „olleh”
[1, 2, 3] [3, 2, 1]
b"abc" b"cba"
23 błąd
null null