public class PositionalOrderBy
extends java.lang.Object
Constructor and Description |
---|
PositionalOrderBy(int[] indices,
boolean[] reverseFlags,
java.lang.Boolean[] nullsFirst) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
static PositionalOrderBy |
fromStream(org.elasticsearch.common.io.stream.StreamInput in) |
int |
hashCode() |
int[] |
indices() |
java.lang.Boolean[] |
nullsFirst() |
static PositionalOrderBy |
of(OrderBy orderBy,
java.util.List<? extends Symbol> orderByInputSymbols)
Create OrderByPositions from a OrderBy definition.
|
boolean[] |
reverseFlags() |
static void |
toStream(PositionalOrderBy orderBy,
org.elasticsearch.common.io.stream.StreamOutput out) |
java.lang.String |
toString() |
PositionalOrderBy |
tryMapToNewOutputs(java.util.List<Symbol> oldOutputs,
java.util.List<Symbol> newOutputs)
Returns a new PositionalOrderBy where the indices are changed so that it uses the newOutputs as base.
|
public PositionalOrderBy(int[] indices, boolean[] reverseFlags, java.lang.Boolean[] nullsFirst)
public int[] indices()
public boolean[] reverseFlags()
public java.lang.Boolean[] nullsFirst()
public java.lang.String toString()
toString
in class java.lang.Object
@Nullable public PositionalOrderBy tryMapToNewOutputs(java.util.List<Symbol> oldOutputs, java.util.List<Symbol> newOutputs)
select b, a from (select a, b .. order by b desc, a asc nulls first) b a oldOutputs: [a, b] -> orderByIndices 1 DESC , 0 ASC NULLS FIRST b a newOutputs: [b, a] -> orderByIndices 0 DESC , 1 ASC NULLS FIRSTIf the newOutputs don't contain a symbol that was used in the oldOutputs `null` is returned.
@Nullable public static PositionalOrderBy fromStream(org.elasticsearch.common.io.stream.StreamInput in) throws java.io.IOException
java.io.IOException
public static void toStream(@Nullable PositionalOrderBy orderBy, org.elasticsearch.common.io.stream.StreamOutput out) throws java.io.IOException
java.io.IOException
@Nullable public static PositionalOrderBy of(@Nullable OrderBy orderBy, java.util.List<? extends Symbol> orderByInputSymbols)
orderByInputSymbols
- symbols which describe the output which should be sorted.
OrderBy.orderBySymbols()
must point to those symbols.
This is used to create the correct indices mapping.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object