배열 원소와 위치를 행으로 펼치기
| 항목 | 값 |
|---|---|
| 화면 이름 | Explode array with position |
| 식별자 | explodeArrayWithPositionV2 |
| 지원 실행 방식 | Batch, Streaming |
| 범주 | 배열 (Array) |
| 반환 자료형 | Struct<Optional[position]:Integer, Optional[element]:T> |
배열 원소마다 행을 만들고, 원소의 상대 위치와 원소 값을 구조체로 반환합니다.
입력 인자
| 이름 | 지정 여부 | 자료형 | 의미와 조건 |
|---|---|---|---|
Array | 필수 | Expression<Array<T>> | 행으로 펼칠 값의 배열입니다. |
Keep empty / null arrays | 선택 | Literal<Boolean> | true이면 빈 배열과 null도 출력에 null로 남깁니다. false이면 해당 항목을 제외합니다. |
자료형 변수의 범위
T는AnyType범위의 자료형을 받습니다.
입출력 예시
예시 1: 기본 동작
인자 값:
Array:arrayKeep empty / null arrays: null
입력 테이블:
| array |
|---|
| [ one, two, three ] |
| [ four, five ] |
출력 테이블:
| array |
|---|
| { element -> one, position -> 1, } |
| { element -> two, position -> 2, } |
| { element -> three, position -> 3, } |
| { element -> four, position -> 1, } |
| { element -> five, position -> 2, } |
예시 2: 경계 조건
인자 값:
Array:arrayKeep empty / null arrays: false
입력 테이블:
| array |
|---|
| [ one, two, three ] |
| [ ] |
| [ four, five ] |
| [ ] |
출력 테이블:
| array |
|---|
| { element -> one, position -> 1, } |
| { element -> two, position -> 2, } |
| { element -> three, position -> 3, } |
| { element -> four, position -> 1, } |
| { element -> five, position -> 2, } |
예시 3: 경계 조건
인자 값:
Array:arrayKeep empty / null arrays: true
입력 테이블:
| array |
|---|
| [ one, two, three ] |
| [ ] |
| [ four, five ] |
| [ ] |
출력 테이블:
| array |
|---|
| { element -> one, position -> 1, } |
| { element -> two, position -> 2, } |
| { element -> three, position -> 3, } |
| { element -> null, position -> null, } |
| { element -> four, position -> 1, } |
| { element -> five, position -> 2, } |
| { element -> null, position -> null, } |