Skip to content

Remove

mapping category: array no `||` new-mode: required resultSize: 1

Drops every element of an ARRAY equal to the given scalar value.

Remove(value) filters an ARRAY, dropping every element that equals value. The result is a new ARRAY containing the surviving elements in their original order. NULL elements are dropped unconditionally.

Typical use is stripping placeholder values from a collected ARRAY, for example after Use(...)[N] produced fields containing "." for missing values.

Available in new mode only.

Parameters

1value Mandatory — accepts: BOOLEAN, DATE, FLOAT, INT, STRING, NULL

The scalar value to drop. Field references and ARRAY literals are not accepted. Equality semantics follow the per-type Value operator.

Input type

  • ARRAY

Output type

  • ARRAY

Requires

  • Exactly one ARRAY-typed pipeline input.

Examples

Strip placeholder strings from a collected ARRAY (test083)

Use(:int1, :int2, :int3, :int4)[4] => Remove(".") | AsInt()

Drop a sentinel integer

:codes => Remove(0)

Errors

  • `Remove': input must be ARRAY-typed
    The pipeline value reaching the rule is not an ARRAY.
  • `Remove' requires exactly one scalar value parameter
    Wrong arity, ARRAY literal, or field reference used as the parameter.
  • `Remove' is only available in new mode
    New mode is not enabled in etl.conf.

See also

RemoveAt, Without, Unique, Size, At