public class SequenceMovingWindowReduceTransform extends Object implements Transform
new SequenceMovingWindowReduceTransform("myCol", 20, ReduceOp.Mean)| Modifier and Type | Class and Description |
|---|---|
static class |
SequenceMovingWindowReduceTransform.EdgeCaseHandling
Enumeration to specify how each cases are handled: For example, for a look back period of 20, how should the
first 19 output values be calculated?
Default: Perform your former reduction as normal, with as many values are available SpecifiedValue: use the given/specified value instead of the actual output value. |
| Constructor and Description |
|---|
SequenceMovingWindowReduceTransform(String columnName,
int lookback,
ReduceOp op) |
SequenceMovingWindowReduceTransform(String columnName,
String newColumnName,
int lookback,
ReduceOp op,
SequenceMovingWindowReduceTransform.EdgeCaseHandling edgeCaseHandling,
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
|
static String |
defaultOutputColumnName(String originalName,
int lookback,
ReduceOp op) |
Schema |
getInputSchema()
Getter for input schema
|
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.
|
String |
toString() |
Schema |
transform(Schema inputSchema)
Get the output schema for this transformation, given an input schema
|
public SequenceMovingWindowReduceTransform(String columnName, int lookback, ReduceOp op)
columnName - Column name to perform windowing onlookback - Look back period for windowingop - Reduction operation to perform on each windowpublic SequenceMovingWindowReduceTransform(String columnName, String newColumnName, int lookback, ReduceOp op, SequenceMovingWindowReduceTransform.EdgeCaseHandling edgeCaseHandling, Writable edgeCaseValue)
columnName - Column name to perform windowing onnewColumnName - Name of the new output column (with results)lookback - Look back period for windowingop - Reduction operation to perform on each windowedgeCaseHandling - How the 1st steps should be handled (positions in sequence with indices less then the look-back period)edgeCaseValue - Used only with EdgeCaseHandling.SpecifiedValue, maybe null otherwisepublic static String defaultOutputColumnName(String originalName, int lookback, ReduceOp op)
public Schema transform(Schema inputSchema)
ColumnOppublic void setInputSchema(Schema inputSchema)
ColumnOpsetInputSchema in interface ColumnOppublic Schema getInputSchema()
ColumnOpgetInputSchema in interface ColumnOppublic List<Writable> map(List<Writable> writables)
Transformpublic List<List<Writable>> mapSequence(List<List<Writable>> sequence)
TransformmapSequence in interface Transformpublic Object mapSequence(Object sequence)
mapSequence in interface Transformsequence - public String outputColumnName()
outputColumnName in interface ColumnOppublic String[] outputColumnNames()
outputColumnNames in interface ColumnOppublic String[] columnNames()
columnNames in interface ColumnOppublic String columnName()
columnName in interface ColumnOpCopyright © 2017. All rights reserved.