Record Class SortingColumn
java.lang.Object
java.lang.Record
dev.hardwood.metadata.SortingColumn
- Record Components:
columnPath- the leaf column's dotted path as the schema spells it, syntheticlist.elementandkey_value.keysegments includeddescending- whether the column sorts from greatest to leastnullOrder- where the column's nulls sort
public record SortingColumn(String columnPath, boolean descending, SortingColumn.NullOrder nullOrder)
extends Record
One column of the order a row group's rows are sorted in: the column, its direction, and where its nulls go.
A row group's sorting columns order its rows lexicographically: by the first column, rows
equal there by the second, and so on. A column's values compare in its column order, the
order its statistics use: signed or unsigned by its annotation, a DECIMAL by the number it
holds, a STRING byte by byte. A floating-point NaN sorts after every number, and -0.0
equals 0.0.
Build one through ascending(String, SortingColumn.NullOrder) or descending.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhere a sorting column's nulls go relative to its values. -
Constructor Summary
ConstructorsConstructorDescriptionSortingColumn(String columnPath, boolean descending, SortingColumn.NullOrder nullOrder) Creates an instance of aSortingColumnrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic SortingColumnascending(String columnPath, SortingColumn.NullOrder nullOrder) A column sorted from least to greatest.Returns the value of thecolumnPathrecord component.booleanReturns the value of thedescendingrecord component.static SortingColumndescending(String columnPath, SortingColumn.NullOrder nullOrder) A column sorted from greatest to least.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thenullOrderrecord component.booleanWhether the column's nulls sort before its values.toString()The column as SQL spells a sort key, such aspickup_ts ASC NULLS FIRST.
-
Constructor Details
-
SortingColumn
Creates an instance of aSortingColumnrecord class.- Parameters:
columnPath- the value for thecolumnPathrecord componentdescending- the value for thedescendingrecord componentnullOrder- the value for thenullOrderrecord component
-
-
Method Details
-
ascending
A column sorted from least to greatest.- Parameters:
columnPath- the leaf column's dotted pathnullOrder- where the column's nulls sort- Returns:
- the sorting column
- Throws:
IllegalArgumentException- if either argument isnull
-
descending
A column sorted from greatest to least.- Parameters:
columnPath- the leaf column's dotted pathnullOrder- where the column's nulls sort- Returns:
- the sorting column
- Throws:
IllegalArgumentException- if either argument isnull
-
nullsFirst
public boolean nullsFirst()Whether the column's nulls sort before its values. -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
columnPath
Returns the value of thecolumnPathrecord component.- Returns:
- the value of the
columnPathrecord component
-
descending
public boolean descending()Returns the value of thedescendingrecord component.- Returns:
- the value of the
descendingrecord component
-
nullOrder
-