Class RemoveRecordField
java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processors.standard.AbstractRecordProcessor
org.apache.nifi.processors.standard.RemoveRecordField
- All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent,org.apache.nifi.processor.Processor
@SideEffectFree
@SupportsBatching
@InputRequirement(INPUT_REQUIRED)
@Tags({"update","record","generic","schema","json","csv","avro","freeform","text","remove","delete"})
@CapabilityDescription("Modifies the contents of a FlowFile that contains Record-oriented data (i.e. data that can be read via a RecordReader and written by a RecordWriter) by removing selected fields. This Processor requires that at least one user-defined Property be added. The name of the property is ignored by the processor, but could be a meaningful identifier for the user. The value of the property should indicate a RecordPath that determines the field to be removed. The processor executes the removal in the order in which these properties are added to the processor. Set the \"Record Writer\" to \"Inherit Record Schema\" in order to use the updated Record Schema modified when removing Fields.")
@WritesAttributes(@WritesAttribute(attribute="record.error.message",description="This attribute provides on failure the error message encountered by the Reader or Writer."))
@DynamicProperty(name="A description of the field to remove",
value="A RecordPath to the field to be removed.",
description="Any field that matches the RecordPath set as the value will be removed.",
expressionLanguageScope=FLOWFILE_ATTRIBUTES)
@SeeAlso(UpdateRecord.class)
@UseCase(description="Remove one or more fields from a Record, where the names of the fields to remove are known.",
keywords={"record","field","drop","remove","delete","expunge","recordpath"},
configuration="Configure the Record Reader according to the incoming data format.\nConfigure the Record Writer according to the desired output format.\n\nFor each field that you want to remove, add a single new property to the Processor.\nThe name of the property can be anything but it\'s recommended to use a brief description of the field.\nThe value of the property is a RecordPath that matches the field to remove.\n\nFor example, to remove the `name` and `email` fields, add two Properties:\n`name` = `/name`\n`email` = `/email`\n")
public class RemoveRecordField
extends AbstractRecordProcessor
-
Field Summary
FieldsFields inherited from class org.apache.nifi.processors.standard.AbstractRecordProcessor
INCLUDE_ZERO_RECORD_FLOWFILES, RECORD_READER, RECORD_WRITER, REL_FAILURE, REL_SUCCESS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcollectRecordPaths(org.apache.nifi.processor.ProcessContext context) protected Collection<org.apache.nifi.components.ValidationResult> customValidate(org.apache.nifi.components.ValidationContext validationContext) protected org.apache.nifi.components.PropertyDescriptorgetSupportedDynamicPropertyDescriptor(String propertyDescriptorName) protected Recordprocess(Record record, org.apache.nifi.flowfile.FlowFile flowFile, org.apache.nifi.processor.ProcessContext context, long count) Methods inherited from class org.apache.nifi.processors.standard.AbstractRecordProcessor
getRelationships, getSupportedPropertyDescriptors, migrateProperties, onTriggerMethods inherited from class org.apache.nifi.processor.AbstractProcessor
onTriggerMethods inherited from class org.apache.nifi.processor.AbstractSessionFactoryProcessor
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueMethods inherited from class org.apache.nifi.components.AbstractConfigurableComponent
equals, getPropertyDescriptor, getPropertyDescriptors, hashCode, onPropertyModified, validateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.nifi.components.ConfigurableComponent
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validateMethods inherited from interface org.apache.nifi.processor.Processor
isStateful, migrateRelationships
-
Field Details
-
recordPathCache
-
ROOT_PATH
- See Also:
-
-
Constructor Details
-
RemoveRecordField
public RemoveRecordField()
-
-
Method Details
-
getSupportedDynamicPropertyDescriptor
protected org.apache.nifi.components.PropertyDescriptor getSupportedDynamicPropertyDescriptor(String propertyDescriptorName) - Overrides:
getSupportedDynamicPropertyDescriptorin classorg.apache.nifi.components.AbstractConfigurableComponent
-
customValidate
protected Collection<org.apache.nifi.components.ValidationResult> customValidate(org.apache.nifi.components.ValidationContext validationContext) - Overrides:
customValidatein classorg.apache.nifi.components.AbstractConfigurableComponent
-
collectRecordPaths
@OnScheduled public void collectRecordPaths(org.apache.nifi.processor.ProcessContext context) -
process
protected Record process(Record record, org.apache.nifi.flowfile.FlowFile flowFile, org.apache.nifi.processor.ProcessContext context, long count) - Specified by:
processin classAbstractRecordProcessor
-