Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.firebolt.io/llms.txt

Use this file to discover all available pages before exploring further.

Scans through the given array from the first to the last element and replaces array[i] with array[i - 1] if the <function> returns 0. The first element of the given array is not replaced. The Lambda function <function> is mandatory.

Syntax

ARRAY_FILL(<function>, <array>)

Parameters

ParameterDescriptionSupported input types
<function>A Lambda function used to check elements in the array.Any Lambda function
<array>The array to be evaluated by the function.Any array

Return Type

ARRAY of the same type as the input array

Example

The following example returns an array where all values are greater than 1:
SELECT
	ARRAY_FILL(x -> x > 0, [ 1, 2, 3, 9 ]) AS levels;
Returns: 1,2,3,9