Skip to content

[ES|QL] TOP Allow ordering by a different field #128630

Open
@BenB196

Description

@BenB196

Description

Today, when you want to group a set of values into a multi-value, you have 2 options:

  1. VALUES
  2. TOP

Both of these solutions have a gap, it's currently not possible to keep the ordering of the grouped values if they're ordered by a different field (using something like SORT

VALUES explicitly defines this:

The order of the returned values isn’t guaranteed.

TOP on the other hand, currently has an order parameter, however, its ordering is in relation to the field being grouped.

It would be nice to have the ability to have TOP potentially perform ordering on a different field other than the one it will be returning values for.


Use-case

I have data bucketed into days and grouped by a dimension.

I want to collapse the data into a single column MV by dimension, but I want the data to keep the ordering that it had as if I sorted it by the days bucket.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions