REPEAT

All functions > ARRAY > REPEAT

Creates an array by repeating an element a specified number of times.

Syntax

REPEAT(element: T, count: BIGINT) → ARRAY<T>
sql

Type Parameters:

  • T: Any type

Arguments

ParameterTypeRequiredDescription
elementTYesThe element to repeat
countBIGINTYesNumber of times to repeat the element

Returns

Array(T) - Array with the element repeated count times

Notes

  • Creates array with same element repeated multiple times
  • Count must be non-negative
  • Returns empty array if count is 0
  • Useful for generating test data or default values
  • Generic type: (T, BIGINT) → Array(T)
Last update at: 2025/10/13 10:23:46