Class SortOrders

java.lang.Object
org.apache.gravitino.rel.expressions.sorts.SortOrders

public class SortOrders extends Object
Helper methods to create SortOrders to pass into Apache Gravitino.
  • Field Details

    • NONE

      public static final SortOrder[] NONE
      NONE is used to indicate that there is no sort order.
  • Method Details

    • ascending

      public static SortOrders.SortImpl ascending(Expression expression)
      Create a sort order by the given expression with the ascending sort direction and nulls first ordering.
      Parameters:
      expression - The expression to sort by
      Returns:
      The created sort order
    • descending

      public static SortOrders.SortImpl descending(Expression expression)
      Create a sort order by the given expression with the descending sort direction and nulls last ordering.
      Parameters:
      expression - The expression to sort by
      Returns:
      The created sort order
    • of

      public static SortOrders.SortImpl of(Expression expression, SortDirection direction)
      Create a sort order by the given expression with the given sort direction and default null ordering.
      Parameters:
      expression - The expression to sort by
      direction - The sort direction
      Returns:
      The created sort order
    • of

      public static SortOrders.SortImpl of(Expression expression, SortDirection direction, NullOrdering nullOrdering)
      Create a sort order by the given expression with the given sort direction and null ordering.
      Parameters:
      expression - The expression to sort by
      direction - The sort direction
      nullOrdering - The null ordering
      Returns:
      The created sort order