RemoveAt¶
Removes the element at the given 0-based index from an ARRAY.
RemoveAt(N) returns a new ARRAY with the element at index N
dropped. Out-of-range indices are silently ignored — the array is
returned unchanged.
The index parameter accepts either a literal integer or a field
reference. Field-reference indices are resolved per row from the
pipeline values; the referenced field must hold an INT. The
transformer also supports infix arithmetic in the index parameter
(e.g. :len - 1), which is desugared into a preceding Subtract
step.
Available in new mode only.
Parameters¶
- 1 —
indexMandatory — accepts: INT, field -
0-based index, either as an integer literal or a field reference to an
INT-valued pipeline field.
Input type¶
ARRAY
Output type¶
ARRAY
Requires¶
- Exactly one ARRAY-typed pipeline input.
- When index is a field reference the referenced field must hold an INT.
Examples¶
Remove a fixed position
Remove a position computed at runtime
Remove the last element via infix arithmetic
Errors¶
-
`RemoveAt': input must be ARRAY-typed- The pipeline value reaching the rule is not an
ARRAY.
-
`RemoveAt': index field:idx' must be an integer`- The referenced field is not an
INT.
-
`RemoveAt': index field:idx' not found in pipeline`- The referenced field is not present in the current pipeline state.
-
`RemoveAt' is only available in new mode- New mode is not enabled in
etl.conf.