일반 함수
| 이름 | 설명 |
CONCAT
|
유형이 동일한 두 개 이상의 값을 연결합니다. |
LENGTH
|
String, Bytes, Array, Vector 또는 Map의 길이를 계산합니다.
|
REVERSE
|
String, Bytes 또는 Array를 반전합니다.
|
클라이언트 예시
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
구문:
concat[T <: STRING | BYTES | ARRAY](values:T ...) -> T
설명:
유형이 동일한 두 개 이상의 값을 연결합니다.
예:
| 값 | concat(values) |
|---|---|
| "abc", "def" | "abcdef" |
| [1, 2], [3, 4] | [1, 2, 3, 4] |
| b"abc", b"def" | b"abcdef" |
| "abc", [1,2,3], "ghi" | 오류 |
| [1,2,3] | 오류 |
| "abc", null | null |
LENGTH
구문:
length[T <: STRING | BYTES | ARRAY | VECTOR | MAP](value: T) -> INT64
설명:
String, Bytes, Array, Vector 또는 Map 값의 길이를 계산합니다.
예:
| 값 | length(value) |
|---|---|
| "hello" | 5 |
| [1, 2, 3, 4] | 4 |
| b"abcde" | 5 |
| null | null |
| 1 | 오류 |
REVERSE
구문:
reverse[T <: STRING | BYTES | ARRAY](value: T) -> T
설명:
String, Bytes 또는 Array 값을 반전합니다.
예:
| 값 | reverse(value) |
|---|---|
| "hello" | "olleh" |
| [1, 2, 3] | [3, 2, 1] |
| b"abc" | b"cba" |
| 23 | 오류 |
| null | null |