- java.lang.Object
-
- com.pervasive.datarush.operators.AbstractLogicalOperator
-
- com.pervasive.datarush.operators.StreamingOperator
-
- com.pervasive.datarush.operators.ExecutableOperator
-
- com.pervasive.datarush.operators.AbstractExecutableRecordPipeline
-
- com.pervasive.datarush.operators.record.FilterFields
-
- com.pervasive.datarush.operators.record.SelectFields
-
- All Implemented Interfaces:
LogicalOperator
,PipelineOperator<RecordPort>
,RecordPipelineOperator
public class SelectFields extends FilterFields
Preserves a subset of fields from the input records. While similar toRetainFields
, there are two significant behavioral differences:- the fields are reordered according to their order in the filter
- all fields specified in the filter must exist in the input or an error will be raised.
- See Also:
RemapFields
-
-
Field Summary
-
Fields inherited from class com.pervasive.datarush.operators.AbstractExecutableRecordPipeline
input, output
-
-
Constructor Summary
Constructors Constructor Description SelectFields()
Keeps no fields from the input.SelectFields(RecordTextSchema<?> schema)
Keeps the specified fields from the input schema.SelectFields(String... fields)
Keeps the specified fields from the input.SelectFields(List<String> fields)
Keeps the specified fields from the input.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RecordPort
getInput()
Gets the record port providing the input data to the operation.RecordPort
getOutput()
Gets the record port providing the output from the operation.void
setSelectionSchema(RecordTextSchema<?> schema)
Sets the schema with the names of the fields that will be kept.-
Methods inherited from class com.pervasive.datarush.operators.record.FilterFields
computeMetadata, execute, getFieldNames, setFieldNames, setFieldNames
-
Methods inherited from class com.pervasive.datarush.operators.ExecutableOperator
cloneForExecution, getNumInputCopies, getPortSettings, handleInactiveOutput
-
Methods inherited from class com.pervasive.datarush.operators.AbstractLogicalOperator
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyError
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.pervasive.datarush.operators.LogicalOperator
disableParallelism, getInputPorts, getOutputPorts
-
-
-
-
Constructor Detail
-
SelectFields
public SelectFields()
Keeps no fields from the input. To specify fields to keep, useFilterFields.setFieldNames(String...)
. If no fields are specified when the containing graph is executed, an error will be raised.
-
SelectFields
public SelectFields(List<String> fields)
Keeps the specified fields from the input. When the containing graph is executed, an error will be raised if any named field is not present.- Parameters:
fields
- the names of fields to keep.
-
SelectFields
public SelectFields(String... fields)
Keeps the specified fields from the input. When the containing graph is executed, an error will be raised if any named field is not present.- Parameters:
fields
- the names of fields to keep.
-
SelectFields
public SelectFields(RecordTextSchema<?> schema)
Keeps the specified fields from the input schema. When the containing graph is executed, an error will be raised if any named field is not present.- Parameters:
schema
- the schema with the fields to keep.
-
-
Method Detail
-
setSelectionSchema
public void setSelectionSchema(RecordTextSchema<?> schema)
Sets the schema with the names of the fields that will be kept. The ordering of the fields defines the output order.- Parameters:
schema
- the schema that defines the field selection
-
getInput
public RecordPort getInput()
Description copied from class:AbstractExecutableRecordPipeline
Gets the record port providing the input data to the operation.- Specified by:
getInput
in interfacePipelineOperator<RecordPort>
- Overrides:
getInput
in classAbstractExecutableRecordPipeline
- Returns:
- the input port for the operation
-
getOutput
public RecordPort getOutput()
Description copied from class:AbstractExecutableRecordPipeline
Gets the record port providing the output from the operation.- Specified by:
getOutput
in interfacePipelineOperator<RecordPort>
- Overrides:
getOutput
in classAbstractExecutableRecordPipeline
- Returns:
- the output port for the operation
-
-