Class SelectFields

All Implemented Interfaces:
LogicalOperator, PipelineOperator<RecordPort>, RecordPipelineOperator

public class SelectFields extends FilterFields
Preserves a subset of fields from the input records. While similar to RetainFields, 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:
  • Constructor Details

    • SelectFields

      public SelectFields()
      Keeps no fields from the input. To specify fields to keep, use FilterFields.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 Details