bottomk

Type of operation: Filter

Description

Selects all data for each of bottom k ranked groups. If no rank method is provided, a default one will be used. If no grouping is specified, the set of primary key columns will be used as the grouping.

Usage

bottomk k [ , rank ] [ , groupby ]

Argument

Type

Required

Multiple

k

int64

Required

Only one

rank

expression

Optional

Only one

groupby

fieldref

Optional

Only one

Accelerable

bottomk is never accelerable. A dataset that only uses accelerable verbs can be accelerated, making queries on the dataset respond faster.

Examples

bottomk 100

Select the bottom 100 groups using the default rank method: the hash of the group identifiers (the set of primary key columns).

bottomk 100, group_by(clusterUid, namespace)

Similar to the first example, but explicitly specifying the grouping

bottomk 100, min(memory_used)

Select the 100 groups with lowest memory usage in the query window.

bottomk 1, group_by()

This bottomk operates on empty grouping, where all rows belong to the same group, and hence all rows will be selected

bottomk 100, min(memory_used), group_by(clusterUid, namespace)

Rank the minimum memory_used during the query window for each Kubernetes namespace, and select the lowest 100 namespaces.