Fungsi umum

Fungsi Umum

Nama Deskripsi
CONCAT Menyambungkan dua atau beberapa nilai dengan jenis yang sama.
LENGTH Menghitung jumlah karakter String, Bytes, Array, Vector, atau Map.
REVERSE Membalikkan urutan String, Bytes, atau Array.

Contoh Klien

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

Sintaksis:

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

Deskripsi:

Menyambungkan dua atau beberapa nilai dengan jenis yang sama.

Contoh:

nilai concat(values)
"abc", "def" "abcdef"
[1, 2], [3, 4] [1, 2, 3, 4]
b"abc", b"def" b"abcdef"
"abc", [1,2,3], "ghi" error
[1,2,3] error
"abc", null null

LENGTH

Sintaksis:

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

Deskripsi:

Menghitung jumlah karakter nilai String, Bytes, Array, Vector, atau Map.

Contoh:

nilai length(value)
"hello" 5
[1, 2, 3, 4] 4
b"abcde" 5
null null
1 error

REVERSE

Sintaksis:

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

Deskripsi:

Membalikkan urutan nilai String, Bytes atau Array.

Contoh:

nilai reverse(value)
"hello" "olleh"
[1, 2, 3] [3, 2, 1]
b"abc" b"cba"
23 error
null null