public class ConditionalReplaceValueTransformWithDefault extends Object implements Transform, ColumnOp
Note: For sequences, this transform use the convention that each step in the sequence is passed to the condition,
and replaced (or not) separately (i.e., Condition.condition(List
the version without a 'no' Value,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected String |
columnToReplace |
protected Condition |
condition |
protected int |
filterColIdx |
protected Writable |
noVal |
protected Writable |
yesVal |
| Constructor and Description |
|---|
ConditionalReplaceValueTransformWithDefault(String columnToReplace,
Writable yesVal,
Writable noVal,
Condition condition) |
| 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
|
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
|
protected final String columnToReplace
protected Writable yesVal
protected Writable noVal
protected int filterColIdx
protected final Condition condition
public Schema transform(Schema inputSchema)
ColumnOppublic void setInputSchema(Schema inputSchema)
ColumnOpsetInputSchema in interface ColumnOppublic Schema getInputSchema()
ColumnOpgetInputSchema 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<List<Writable>> mapSequence(List<List<Writable>> sequence)
TransformmapSequence in interface Transformpublic Object map(Object input)
Transformpublic Object mapSequence(Object sequence)
TransformmapSequence in interface TransformCopyright © 2019. All rights reserved.