Class FlattenRecord

java.lang.Object
com.northconcepts.datapipeline.transform.Transformer
com.northconcepts.datapipeline.transform.FlattenRecord

public class FlattenRecord extends Transformer
Flattens an array field by creating one record for each value. See FieldPath for supported field name expressions.
  • Constructor Details

    • FlattenRecord

      public FlattenRecord()
  • Method Details

    • getFieldSeparator

      public String getFieldSeparator()
      Returns the separator placed between parent names, child names and array indexes in flattened field names (default is "_").
    • setFieldSeparator

      public FlattenRecord setFieldSeparator(String fieldSeparator)
      Sets the separator placed between parent names, child names and array indexes in flattened field names (default is "_").
    • transform

      public boolean transform(Record record) throws Throwable
      Description copied from class: Transformer
      Applies this transformer to a record on its way through a TransformingReader or TransformingWriter.

      Contract for subclasses (see also docs/authoring/Transformer.md):

      • Mutate record in place as needed.
      • Return true to keep the record in the pipeline.
      • Return false to drop the record (the host routes it to a discard writer if one is configured, otherwise it disappears).
      • Throw to fail (or route to a discard writer, depending on host configuration).
      • Do not call incrementRecordCount() on the host endpoint; the host handles it.
      Specified by:
      transform in class Transformer
      Throws:
      Throwable
    • addExceptionProperties

      public DataException addExceptionProperties(DataException exception)
      Description copied from class: Transformer
      Adds this transformer's details to an exception raised by its host reader or writer; returns the same exception.
      Overrides:
      addExceptionProperties in class Transformer
    • toString

      public String toString()
      Overrides:
      toString in class Object