public final class DataOrdering extends Object
RecordMetadata
that describes how
the data is ordered.
Operators may declare a required ordering by calling RecordPort.setRequiredDataOrdering(com.pervasive.datarush.operators.MetadataCalculationContext, com.pervasive.datarush.ports.record.DataOrdering)
.
It is the responsibility of the framework to ensure that the specified requirement is met.
Operators may also declare their output ordering by calling RecordPort.setOutputDataDistribution(com.pervasive.datarush.operators.MetadataCalculationContext, com.pervasive.datarush.ports.record.DataDistribution)
.
This lets the framework know how data is ordered on the operator's output. If there is
an mismatch between required and provided metadata, the framework will automatically sort
as needed.
StreamingOperator#computeMetadata
,
IterativeOperator#computeMetadata
Modifier and Type | Field and Description |
---|---|
static DataOrdering |
UNSPECIFIED
The default data ordering if not specified.
|
Constructor and Description |
---|
DataOrdering(List<SortKey> keys)
Specify that data is ordered by the given set of keys.
|
DataOrdering(SortKey[] keys)
Specify that data is ordered by the given set of keys.
|
Modifier and Type | Method and Description |
---|---|
AliasSet[] |
getAliases() |
SortKey[] |
getKeys()
Returns the keys that the data is sorted by
|
SortKey[] |
getPrefixOrdering(String[] prefix)
Returns a prefix of the current ordering, merged with
sort direction information.
|
boolean |
isOrdered(SortKey[] desired)
Returns true if data is ordered by the specified ordering or a prefix
of the specified ordering.
|
boolean |
isOrdered(String[] desired)
Returns true if data is ordered by the specified ordering or a prefix
of the specified ordering.
|
boolean |
isUnspecified()
Returns whether this is the unspecified data ordering.
|
DataOrdering |
remap(FieldRemapping mapping)
Applies the given field remapping to this ordering, changing names as required.
|
String |
toString() |
public static final DataOrdering UNSPECIFIED
public DataOrdering(List<SortKey> keys)
keys
- specifies field names and ascending vs. descendingpublic DataOrdering(SortKey[] keys)
keys
- specifies field names and ascending vs. descendingpublic boolean isOrdered(SortKey[] desired)
desired
- the desired data orderingpublic boolean isOrdered(String[] desired)
isOrdered(SortKey[])
instead.desired
- the desired data orderingpublic AliasSet[] getAliases()
public SortKey[] getKeys()
public boolean isUnspecified()
public SortKey[] getPrefixOrdering(String[] prefix)
isOrdered(String[])
.
If data is ordered, they will then call this method to determine specific
directional information.prefix
- must be a prefix of the data orderingIllegalArgumentException
- if the data is not ordered by the given
prefixpublic DataOrdering remap(FieldRemapping mapping)
UNSPECIFIED
ordering.mapping
- the field remapping.Copyright © 2016 Actian Corporation. All rights reserved.