public abstract class BaseColumnsMathOpTransform extends Object implements Transform, ColumnOp
IntegerMathOpTransform, DoubleMathOpTransform, LongMathOpTransform for operations
with a scalar + single column, instea| Modifier and Type | Field and Description |
|---|---|
protected String[] |
columns |
protected MathOp |
mathOp |
protected String |
newColumnName |
| Constructor and Description |
|---|
BaseColumnsMathOpTransform(String newColumnName,
MathOp mathOp,
String... columns) |
| 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
|
protected abstract ColumnMetaData |
derivedColumnMetaData(String newColumnName,
Schema inputSchema) |
protected abstract Writable |
doOp(Writable... input) |
Schema |
getInputSchema()
Getter for input schema
|
List<Writable> |
map(List<Writable> writables)
Transform a writable
in to another writable
|
List<List<Writable>> |
mapSequence(List<List<Writable>> 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.
|
abstract String |
toString() |
Schema |
transform(Schema inputSchema)
Get the output schema for this transformation, given an input schema
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitmap, mapSequenceprotected final String newColumnName
protected final MathOp mathOp
protected final String[] columns
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 String outputColumnName()
outputColumnName in interface ColumnOppublic String[] outputColumnNames()
outputColumnNames in interface ColumnOppublic String[] columnNames()
columnNames in interface ColumnOppublic String columnName()
columnName in interface ColumnOpprotected abstract ColumnMetaData derivedColumnMetaData(String newColumnName, Schema inputSchema)
Copyright © 2019. All rights reserved.