public class SequenceOffsetTransform extends Object implements Transform
Additionally, there are 2 modes for handling values outside the original sequence (EdgeHandling enum):
TrimSequence: the entire sequence is trimmed (start or end) by a specified number of steps
SpecifiedValue: for any values outside of the original sequence, they are given a specified value
Note 1: When specifying offsets, they are done as follows: Positive offsets: move the values in the specified columns to a later time. Earlier time steps are either be trimmed or Given specified values; the last values in these columns will be truncated/removed.
Note 2: Care must be taken when using TrimSequence: for example, if we chain multiple sequence offset transforms on the
one dataset, we may end up trimming much more than we want. In this case, it may be better to use SpecifiedValue,
(with, for example, NullWritable) and then do a single trim operation (via SequenceTrimTransform)
at the end.
| Modifier and Type | Class and Description |
|---|---|
static class |
SequenceOffsetTransform.EdgeHandling |
static class |
SequenceOffsetTransform.OperationType |
| Constructor and Description |
|---|
SequenceOffsetTransform(List<String> columnsToOffset,
int offsetAmount,
SequenceOffsetTransform.OperationType operationType,
SequenceOffsetTransform.EdgeHandling edgeHandling,
Writable edgeCaseValue) |
| Modifier and Type | Method and Description |
|---|---|
String |
columnName()
Returns a singular column name
this op is meant to run on
|
String[] |
columnNames()
Returns column names
this op is meant to run on
|
List<Writable> |
map(List<Writable> writables)
Transform a writable
in to another writable
|
Object |
map(Object input)
Transform an object
in to another object
|
List<List<Writable>> |
mapSequence(List<List<Writable>> sequence)
Transform a sequence
|
Object |
mapSequence(Object sequence)
Transform a sequence
|
String |
outputColumnName()
The output column name
after the operation has been applied
|
String[] |
outputColumnNames()
The output column names
This will often be the same as the input
|
void |
setInputSchema(Schema inputSchema)
Set the input schema.
|
Schema |
transform(Schema inputSchema) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetInputSchemapublic SequenceOffsetTransform(List<String> columnsToOffset, int offsetAmount, SequenceOffsetTransform.OperationType operationType, SequenceOffsetTransform.EdgeHandling edgeHandling, Writable edgeCaseValue)
public void setInputSchema(Schema inputSchema)
ColumnOpsetInputSchema in interface ColumnOppublic String outputColumnName()
ColumnOpoutputColumnName in interface ColumnOppublic String[] outputColumnNames()
ColumnOpoutputColumnNames in interface ColumnOppublic String[] columnNames()
ColumnOpcolumnNames in interface ColumnOppublic String columnName()
ColumnOpcolumnName in interface ColumnOppublic List<Writable> map(List<Writable> writables)
Transformpublic List<List<Writable>> mapSequence(List<List<Writable>> sequence)
TransformmapSequence in interface Transformpublic Object map(Object input)
Transformpublic Object mapSequence(Object sequence)
TransformmapSequence in interface TransformCopyright © 2020. All rights reserved.