Class FlattenRecord
java.lang.Object
com.northconcepts.datapipeline.transform.Transformer
com.northconcepts.datapipeline.transform.FlattenRecord
Flattens an array field by creating one record for each value.
See
FieldPath for supported field name expressions.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddExceptionProperties(DataException exception) Adds this transformer's details to an exception raised by its host reader or writer; returns the same exception.Returns the separator placed between parent names, child names and array indexes in flattened field names (default is "_").setFieldSeparator(String fieldSeparator) Sets the separator placed between parent names, child names and array indexes in flattened field names (default is "_").toString()booleanApplies this transformer to a record on its way through aTransformingReaderorTransformingWriter.Methods inherited from class com.northconcepts.datapipeline.transform.Transformer
close, geEndpoint, getEndpoint, getReader, getWriter, of, open, setWriter
-
Constructor Details
-
FlattenRecord
public FlattenRecord()
-
-
Method Details
-
getFieldSeparator
Returns the separator placed between parent names, child names and array indexes in flattened field names (default is "_"). -
setFieldSeparator
Sets the separator placed between parent names, child names and array indexes in flattened field names (default is "_"). -
transform
Description copied from class:TransformerApplies this transformer to a record on its way through aTransformingReaderorTransformingWriter.Contract for subclasses (see also
docs/authoring/Transformer.md):- Mutate
recordin place as needed. - Return
trueto keep the record in the pipeline. - Return
falseto 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:
transformin classTransformer- Throws:
Throwable
- Mutate
-
addExceptionProperties
Description copied from class:TransformerAdds this transformer's details to an exception raised by its host reader or writer; returns the same exception.- Overrides:
addExceptionPropertiesin classTransformer
-
toString
-