Skip to content

Fill

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

Creates an ARRAY of count copies of value.

Fill(value, count) produces a fresh ARRAY with count identical elements, each a copy of value. Both parameters may be scalar literals or field references to scalar pipeline values; count must resolve to an integer. A non-positive count yields an empty ARRAY.

Typical use is constructing a base array of a known length that is then combined with other arrays via Append, ReplaceAt, or similar array-aware rules.

Available in new mode only.

Parameters

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

The element value. Each output element is an independent copy of this value.

2count Mandatory — accepts: INT, field

Number of elements to produce. Negative values are clamped to zero, yielding an empty ARRAY.

Input type

Output type

  • ARRAY

Requires

  • count must resolve to an integer at runtime.

Examples

Build a base ARRAY then append a sentinel (test094)

:n => AsInt() => :n_int
Fill(9, :n_int)[] => :base
SetValue([0]) => :zero
Append(:base, :zero)[]

Pre-populate strings of a fixed length

Fill("SRC", :n_int)[] => :base

Errors

  • `Fill': count must be an integer
    The count parameter resolved to a non-integer value at runtime.
  • `Fill': second parameter (count) must be an integer
    Parse-time type check rejected a non-integer count parameter.
  • `Fill' requires exactly two parameters
    Wrong arity.
  • `Fill' is only available in new mode
    New mode is not enabled in etl.conf.

See also

Append, ReplaceAt, SetValue, Use, Size