生成包含一系列相等值的动态数组。Generates a dynamic array holding a series of equal values.


repeat(value, count)repeat(value, count)


  • value :生成数组中元素的值。value : The value of the element in the resulting array. 值的类型可以是 boolean、integer、long、real、datetime 或 timespan。The type of value can be boolean, integer, long, real, datetime, or timespan.
  • count:生成数组中的元素计数。count : The count of the elements in the resulting array. count 必须是整数。The count must be an integer number. 如果 count 等于零,则返回空数组。If count is equal to zero, a empty array is returned. 如果 count 小于零,则返回 null 值。If count is less than zero, a null value is returned.


以下示例返回 [1, 1, 1]The following example returns [1, 1, 1]:

T | extend r = repeat(1, 3)