public class ColumnsToRows extends AbstractExecutableRecordPipeline
input, output
Constructor and Description |
---|
ColumnsToRows() |
Modifier and Type | Method and Description |
---|---|
protected void |
computeMetadata(StreamingMetadataContext ctx)
Implementations must adhere to the following contracts
|
void |
definePivotKeyFamily(String keyFieldName,
String... labels)
Define up to one pivotKeyFamily consisting of the target field and the constant String values.
|
void |
definePivotValueFamily(String valueFieldName,
String... sourceUnpivotFields)
Define a pivotValueFamily consisting of the target field and the source fields to be transposed.
|
protected void |
execute(ExecutionContext ctx)
Executes the operator.
|
List<String> |
getGroupKeyFields() |
Map<String,List<String>> |
getKeyMap() |
Map<String,List<String>> |
getValueMap() |
List<String> |
getValueOrder() |
void |
setGroupKeyFields(String... groupKeyFields)
Optional parameter to specify the fixed or repeating key fields.
|
void |
setKeyMap(Map<String,List<String>> keyMap)
Sets the name of the output field and the constant values (labels) that will appear with their corresponding valueMap entry based on position.
|
void |
setValueMap(Map<String,List<String>> valueMap)
Sets the name of the output field and the list of input fields which will be transposed in the output.
|
void |
setValueOrder(List<String> valueOrder)
Indicates the order of the fields defined in the valueMap to appear in the output.
|
getInput, getOutput
cloneForExecution, getNumInputCopies, getPortSettings, handleInactiveOutput
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyError
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
disableParallelism, getInputPorts, getOutputPorts
public void definePivotValueFamily(String valueFieldName, String... sourceUnpivotFields)
valueFieldName
- the name of the field to appear in the outputsourceUnpivotFields
- the source fields to be pivotedpublic void definePivotKeyFamily(String keyFieldName, String... labels)
keyFieldName
- the name of the field to appear in the outputlabels
- the String values that will be added to each defined pivot value familyprotected void execute(ExecutionContext ctx)
ExecutableOperator
execute
in class ExecutableOperator
ctx
- context in which to lookup physical ports bound to logical portsprotected void computeMetadata(StreamingMetadataContext ctx)
StreamingOperator
StreamingMetadataContext.parallelize(ParallelismStrategy)
.
RecordPort#setRequiredDataOrdering
, otherwise data may arrive in any order.
RecordPort#setRequiredDataDistribution
, otherwise data will arrive in an unspecified partial distribution
.
RecordPort#getSourceDataDistribution
and RecordPort#getSourceDataOrdering
. These should be
viewed as a hints to help chose a more efficient algorithm. In such cases, though, operators must
still declare data ordering and data distribution requirements; otherwise there is no guarantee that
data will arrive sorted/distributed as required.
RecordPort#setType
.RecordPort#setOutputDataOrdering
RecordPort#setOutputDataDistribution
AbstractModelPort#setMergeHandler
.MergeModel
is a convenient, re-usable model reducer, parameterized with
a merge-handler.
SimpleModelPort
's have no associated metadata and therefore there is
never any output metadata to declare. PMMLPort
's, on the other hand,
do have associated metadata. For all PMMLPorts, implementations must declare
the following:
PMMLPort.setPMMLModelSpec
.
computeMetadata
in class StreamingOperator
ctx
- the contextpublic void setGroupKeyFields(String... groupKeyFields)
groupKeyFields
- public void setValueOrder(List<String> valueOrder)
valueOrder
- list of the fields in the valueMap in the order you wish for them to appear in the output.public void setKeyMap(Map<String,List<String>> keyMap)
keyMap
- output field name and list of label fields to appear in this column in the output.public void setValueMap(Map<String,List<String>> valueMap)
valueMap
- output field name and lsit of input fields to be transposed to this column in the output.Copyright © 2024 Actian Corporation. All rights reserved.