Class AttributesToCSV

java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processors.standard.AttributesToCSV
All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent, org.apache.nifi.processor.Processor

@SideEffectFree @SupportsBatching @Tags({"csv","attributes","flowfile"}) @InputRequirement(INPUT_REQUIRED) @CapabilityDescription("Generates a CSV representation of the input FlowFile Attributes. The resulting CSV can be written to either a newly generated attribute named \'CSVAttributes\' or written to the FlowFile as content. If the attribute value contains a comma, newline or double quote, then the attribute value will be escaped with double quotes. Any double quote characters in the attribute value are escaped with another double quote.") @WritesAttribute(attribute="CSVSchema",description="CSV representation of the Schema") @WritesAttribute(attribute="CSVData",description="CSV representation of Attributes") public class AttributesToCSV extends org.apache.nifi.processor.AbstractProcessor
  • Field Details

    • DATA_ATTRIBUTE_NAME

      private static final String DATA_ATTRIBUTE_NAME
      See Also:
    • SCHEMA_ATTRIBUTE_NAME

      private static final String SCHEMA_ATTRIBUTE_NAME
      See Also:
    • OUTPUT_SEPARATOR

      private static final String OUTPUT_SEPARATOR
      See Also:
    • OUTPUT_MIME_TYPE

      private static final String OUTPUT_MIME_TYPE
      See Also:
    • SPLIT_REGEX

      private static final String SPLIT_REGEX
      See Also:
    • OUTPUT_OVERWRITE_CONTENT

      static final org.apache.nifi.components.AllowableValue OUTPUT_OVERWRITE_CONTENT
    • OUTPUT_NEW_ATTRIBUTE

      static final org.apache.nifi.components.AllowableValue OUTPUT_NEW_ATTRIBUTE
    • ATTRIBUTES_LIST

      public static final org.apache.nifi.components.PropertyDescriptor ATTRIBUTES_LIST
    • ATTRIBUTES_REGEX

      public static final org.apache.nifi.components.PropertyDescriptor ATTRIBUTES_REGEX
    • DESTINATION

      public static final org.apache.nifi.components.PropertyDescriptor DESTINATION
    • INCLUDE_CORE_ATTRIBUTES

      public static final org.apache.nifi.components.PropertyDescriptor INCLUDE_CORE_ATTRIBUTES
    • NULL_VALUE_FOR_EMPTY_STRING

      public static final org.apache.nifi.components.PropertyDescriptor NULL_VALUE_FOR_EMPTY_STRING
    • INCLUDE_SCHEMA

      public static final org.apache.nifi.components.PropertyDescriptor INCLUDE_SCHEMA
    • PROPERTY_DESCRIPTORS

      private static final List<org.apache.nifi.components.PropertyDescriptor> PROPERTY_DESCRIPTORS
    • REL_SUCCESS

      public static final org.apache.nifi.processor.Relationship REL_SUCCESS
    • REL_FAILURE

      public static final org.apache.nifi.processor.Relationship REL_FAILURE
    • RELATIONSHIPS

      private static final Set<org.apache.nifi.processor.Relationship> RELATIONSHIPS
    • includeCoreAttributes

      private volatile Boolean includeCoreAttributes
    • coreAttributes

      private volatile Set<String> coreAttributes
    • destinationContent

      private volatile boolean destinationContent
    • nullValForEmptyString

      private volatile boolean nullValForEmptyString
    • pattern

      private volatile Pattern pattern
    • includeSchema

      private volatile Boolean includeSchema
  • Constructor Details

    • AttributesToCSV

      public AttributesToCSV()
  • Method Details

    • getSupportedPropertyDescriptors

      protected List<org.apache.nifi.components.PropertyDescriptor> getSupportedPropertyDescriptors()
      Overrides:
      getSupportedPropertyDescriptors in class org.apache.nifi.components.AbstractConfigurableComponent
    • getRelationships

      public Set<org.apache.nifi.processor.Relationship> getRelationships()
      Specified by:
      getRelationships in interface org.apache.nifi.processor.Processor
      Overrides:
      getRelationships in class org.apache.nifi.processor.AbstractSessionFactoryProcessor
    • buildAttributesMapForFlowFile

      private Map<String,String> buildAttributesMapForFlowFile(org.apache.nifi.flowfile.FlowFile ff, Set<String> attributes, Pattern attPattern)
    • attributeListStringToSet

      private Set<String> attributeListStringToSet(String attributeList)
    • onScheduled

      @OnScheduled public void onScheduled(org.apache.nifi.processor.ProcessContext context)
    • onTrigger

      public void onTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) throws org.apache.nifi.processor.exception.ProcessException
      Specified by:
      onTrigger in class org.apache.nifi.processor.AbstractProcessor
      Throws:
      org.apache.nifi.processor.exception.ProcessException