Interface GroupOrderKeyResolver


public interface GroupOrderKeyResolver
Resolves the sort value of an ORDER BY item that could NOT be matched to a SELECT column after GROUP BY / aggregation — Snowflake allows ordering by a grouped column or an aggregate that is not in the SELECT list (e.g. SELECT grp FROM t GROUP BY grp, x ORDER BY x or … ORDER BY MAX(y)). The value is computed over the source rows of the output row's group, using its ORIGINAL (pre-sort) index.
  • Method Summary

    Modifier and Type
    Method
    Description
    The ORDER BY value for the output row at rowIndex (its original position before sorting), computed over that row's group.
  • Method Details

    • resolve

      Object resolve(int rowIndex, FrostlakeParser.OrderItemContext item)
      The ORDER BY value for the output row at rowIndex (its original position before sorting), computed over that row's group.