Value Selection

Functions on this page are all related to selecting a value or a group of values from a larger set.

any

any returns the first value it encounters in a set of data. The return value is non-deterministic.

Parameters:

  • column - the column you want a random value from.

Usage:

  • any(column)

Returns:

  • A value from the column that is the same data type as the column.

anyHeavy

anyHeavy a frequently occuring value in the column, using the Heavy Hitters algorithm. The behavior is non-deterministic.

Parameters:

  • column - the column value you want a frequently occuring value from

Usage:

  • anyHeavy(column)

Returns:

  • A value from the column that is the same data type as the column.

anyLast

anyLast returns the last value it encounters in a set of data. The return value is non-deterministic.

Parameters:

  • column - the column you want a value from.

Usage:

  • anyLast(column)

Returns:

  • A value from the column that is the same data type as the column.

groupArray

groupArray functions return a list of values from a data_set.

Parameters:

  • num_items (Optional) - the number of items to return. If not specified, all values are returned in the array.
  • data_set - the data set to pull values from. Usually a column.

Usage:

  • groupArray(data_set)
  • groupArray(num_items)(data_set)

Returns:

  • A value from the column that is the same data type as the column. The set order and values are non-deterministic.

groupUniqArray

groupUniqArray functions return a list of values from a data_set, but differ from groupArray in that the set of values returned in the array are individually unique. No values are repeated. You can compare the results of groupArray and groupUniqArray test queries on this page to see the difference.

Parameters:

  • num_items (Optional) - the number of items to return. If not specified, all values are returned in the array.
  • data_set - the data set to pull values from. Usually a column.

Usage:

  • groupUniqArray(data_set)
  • groupUniqArray(num_items)(data_set)

Returns:

  • A value from the column that is the same data type as the column. The set order and values are non-deterministic.

Did this page help you?