blob: 5e75afbd294f80d0a4c557f8daadbf5e7829681e [file] [log] [blame]
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"></meta><title>DeduplicateRecord</title><link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css"></link></head><script type="text/javascript">window.onload = function(){if(self==top) { document.getElementById('nameHeader').style.display = "inherit"; } }</script><body><h1 id="nameHeader" style="display: none;">DeduplicateRecord</h1><h2>Description: </h2><p>This processor attempts to deduplicate a record set in memory using either a hashset or a bloom filter. It operates on a per-file basis rather than across an entire data set that spans multiple files.</p><h3>Tags: </h3><p>text, record, update, change, replace, modify, distinct, unique, filter, hash, dupe, duplicate, dedupe</p><h3>Properties: </h3><p>In the list below, the names of required properties appear in <strong>bold</strong>. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the <a href="../../../../../html/expression-language-guide.html">NiFi Expression Language</a>.</p><table id="properties"><tr><th>Display Name</th><th>API Name</th><th>Default Value</th><th>Allowable Values</th><th>Description</th></tr><tr><td id="name"><strong>Deduplication Strategy</strong></td><td>deduplication-strategy</td><td id="default-value">Single File</td><td id="allowable-values"><ul><li>Single File</li><li>Multiple Files</li></ul></td><td id="description">The strategy to use for detecting and isolating duplicate records. The option for doing it across a single data file will operate in memory, whereas the one for going across the enter repository will require a distributed map cache.</td></tr><tr><td id="name">Distributed Map Cache client</td><td>distributed-map-cache</td><td></td><td id="allowable-values"><strong>Controller Service API: </strong><br/>DistributedMapCacheClient<br/><strong>Implementations: </strong><a href="../../../nifi-distributed-cache-services-nar/1.19.1/org.apache.nifi.distributed.cache.client.DistributedMapCacheClientService/index.html">DistributedMapCacheClientService</a><br/><a href="../../../nifi-redis-nar/1.19.1/org.apache.nifi.redis.service.RedisDistributedMapCacheClientService/index.html">RedisDistributedMapCacheClientService</a><br/><a href="../../../nifi-hbase_1_1_2-client-service-nar/1.19.1/org.apache.nifi.hbase.HBase_1_1_2_ClientMapCacheService/index.html">HBase_1_1_2_ClientMapCacheService</a><br/><a href="../../../nifi-hazelcast-services-nar/1.19.1/org.apache.nifi.hazelcast.services.cacheclient.HazelcastMapCacheClient/index.html">HazelcastMapCacheClient</a><br/><a href="../../../nifi-hbase_2-client-service-nar/1.19.1/org.apache.nifi.hbase.HBase_2_ClientMapCacheService/index.html">HBase_2_ClientMapCacheService</a><br/><a href="../../../nifi-cassandra-services-nar/1.19.1/org.apache.nifi.controller.cassandra.CassandraDistributedMapCache/index.html">CassandraDistributedMapCache</a><br/><a href="../../../nifi-couchbase-nar/1.19.1/org.apache.nifi.couchbase.CouchbaseMapCacheClient/index.html">CouchbaseMapCacheClient</a></td><td id="description">This configuration is required when the deduplication strategy is set to 'multiple files.' The map cache will be used to check a data source such as HBase or Redis for entries indicating that a record has been processed before. This option requires a downstream process that uses PutDistributedMapCache to write an entry to the cache data source once the record has been processed to indicate that it has been handled before.<br/><br/><strong>This Property is only considered if </strong><strong>the [Deduplication Strategy] Property has a value of "Multiple Files".</strong></td></tr><tr><td id="name">Cache Identifier</td><td>cache-identifier</td><td></td><td id="allowable-values"></td><td id="description">This option defines a record path operation to use for defining the cache identifier. It can be used in addition to the hash settings. This field will have the expression language attribute "record.hash.value" available to it to use with it to generate the record path operation.<br/><strong>Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)</strong><br/><br/><strong>This Property is only considered if </strong><strong>the [Deduplication Strategy] Property has a value of "Multiple Files".</strong></td></tr><tr><td id="name"><strong>Record Reader</strong></td><td>record-reader</td><td></td><td id="allowable-values"><strong>Controller Service API: </strong><br/>RecordReaderFactory<br/><strong>Implementations: </strong><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.grok.GrokReader/index.html">GrokReader</a><br/><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.xml.XMLReader/index.html">XMLReader</a><br/><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.avro.AvroReader/index.html">AvroReader</a><br/><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.syslog.Syslog5424Reader/index.html">Syslog5424Reader</a><br/><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.cef.CEFReader/index.html">CEFReader</a><br/><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.syslog.SyslogReader/index.html">SyslogReader</a><br/><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.json.JsonTreeReader/index.html">JsonTreeReader</a><br/><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.csv.CSVReader/index.html">CSVReader</a><br/><a href="../../../nifi-scripting-nar/1.19.1/org.apache.nifi.record.script.ScriptedReader/index.html">ScriptedReader</a><br/><a href="../../../nifi-parquet-nar/1.19.1/org.apache.nifi.parquet.ParquetReader/index.html">ParquetReader</a><br/><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.json.JsonPathReader/index.html">JsonPathReader</a><br/><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.lookup.ReaderLookup/index.html">ReaderLookup</a><br/><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.windowsevent.WindowsEventLogReader/index.html">WindowsEventLogReader</a></td><td id="description">Specifies the Controller Service to use for reading incoming data</td></tr><tr><td id="name"><strong>Record Writer</strong></td><td>record-writer</td><td></td><td id="allowable-values"><strong>Controller Service API: </strong><br/>RecordSetWriterFactory<br/><strong>Implementations: </strong><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.text.FreeFormTextRecordSetWriter/index.html">FreeFormTextRecordSetWriter</a><br/><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.avro.AvroRecordSetWriter/index.html">AvroRecordSetWriter</a><br/><a href="../../../nifi-scripting-nar/1.19.1/org.apache.nifi.record.script.ScriptedRecordSetWriter/index.html">ScriptedRecordSetWriter</a><br/><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.csv.CSVRecordSetWriter/index.html">CSVRecordSetWriter</a><br/><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.xml.XMLRecordSetWriter/index.html">XMLRecordSetWriter</a><br/><a href="../../../nifi-parquet-nar/1.19.1/org.apache.nifi.parquet.ParquetRecordSetWriter/index.html">ParquetRecordSetWriter</a><br/><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.json.JsonRecordSetWriter/index.html">JsonRecordSetWriter</a><br/><a href="../../../nifi-record-serialization-services-nar/1.19.1/org.apache.nifi.lookup.RecordSetWriterLookup/index.html">RecordSetWriterLookup</a></td><td id="description">Specifies the Controller Service to use for writing out the records</td></tr><tr><td id="name"><strong>Include Zero Record FlowFiles</strong></td><td>include-zero-record-flowfiles</td><td id="default-value">true</td><td id="allowable-values"><ul><li>true</li><li>false</li></ul></td><td id="description">When converting an incoming FlowFile, if the conversion results in no data, this property specifies whether or not a FlowFile will be sent to the corresponding relationship</td></tr><tr><td id="name"><strong>Record Hashing Algorithm</strong></td><td>record-hashing-algorithm</td><td id="default-value">SHA-256</td><td id="allowable-values"><ul><li>None <img src="../../../../../html/images/iconInfo.png" alt="Do not use a hashing algorithm. The value of resolved RecordPaths will be combined with tildes (~) to form the unique record key. This may use significantly more storage depending on the size and shape or your data." title="Do not use a hashing algorithm. The value of resolved RecordPaths will be combined with tildes (~) to form the unique record key. This may use significantly more storage depending on the size and shape or your data."></img></li><li>SHA-256 <img src="../../../../../html/images/iconInfo.png" alt="The SHA-256 cryptographic hash algorithm." title="The SHA-256 cryptographic hash algorithm."></img></li><li>SHA-512 <img src="../../../../../html/images/iconInfo.png" alt="The SHA-512 cryptographic hash algorithm." title="The SHA-512 cryptographic hash algorithm."></img></li></ul></td><td id="description">The algorithm used to hash the combined set of resolved RecordPath values for cache storage.</td></tr><tr><td id="name"><strong>Filter Type</strong></td><td>filter-type</td><td id="default-value">HashSet</td><td id="allowable-values"><ul><li>HashSet <img src="../../../../../html/images/iconInfo.png" alt="Exactly matches records seen before with 100% accuracy at the expense of more storage usage. Stores the filter data in a single cache entry in the distributed cache, and is loaded entirely into memory during duplicate detection. This filter is preferred for small to medium data sets and offers high performance loaded into memory when this processor is running." title="Exactly matches records seen before with 100% accuracy at the expense of more storage usage. Stores the filter data in a single cache entry in the distributed cache, and is loaded entirely into memory during duplicate detection. This filter is preferred for small to medium data sets and offers high performance loaded into memory when this processor is running."></img></li><li>BloomFilter <img src="../../../../../html/images/iconInfo.png" alt="Space-efficient data structure ideal for large data sets using probability to determine if a record was seen previously. False positive matches are possible, but false negatives are not – in other words, a query returns either &quot;possibly in the set&quot; or &quot;definitely not in the set&quot;. You should use this option if the FlowFile content is large and you can tolerate some duplication in the data. Uses constant storage space regardless of the record set size." title="Space-efficient data structure ideal for large data sets using probability to determine if a record was seen previously. False positive matches are possible, but false negatives are not – in other words, a query returns either &quot;possibly in the set&quot; or &quot;definitely not in the set&quot;. You should use this option if the FlowFile content is large and you can tolerate some duplication in the data. Uses constant storage space regardless of the record set size."></img></li></ul></td><td id="description">The filter used to determine whether a record has been seen before based on the matching RecordPath criteria. If hash set is selected, a Java HashSet object will be used to deduplicate all encountered records. If the bloom filter option is selected, a bloom filter will be used. The bloom filter option is less memory intensive, but has a chance of having false positives.<br/><br/><strong>This Property is only considered if </strong><strong>the [Deduplication Strategy] Property has a value of "Single File".</strong></td></tr><tr><td id="name"><strong>Filter Capacity Hint</strong></td><td>filter-capacity-hint</td><td id="default-value">25000</td><td id="allowable-values"></td><td id="description">An estimation of the total number of unique records to be processed. The more accurate this number is will lead to fewer false negatives on a BloomFilter.<br/><br/><strong>This Property is only considered if </strong><strong>the [Filter Type] Property has a value of "BloomFilter".</strong></td></tr><tr><td id="name">Bloom Filter Certainty</td><td>bloom-filter-certainty</td><td id="default-value">0.10</td><td id="allowable-values"></td><td id="description">The desired false positive probability when using the BloomFilter type. Using a value of .05 for example, guarantees a five-percent probability that the result is a false positive. The closer to 1 this value is set, the more precise the result at the expense of more storage space utilization.</td></tr></table><h3>Dynamic Properties: </h3><p>Supports Sensitive Dynamic Properties: <strong>No</strong></p><p>Dynamic Properties allow the user to specify both the name and value of a property.<table id="dynamic-properties"><tr><th>Name</th><th>Value</th><th>Description</th></tr><tr><td id="name">RecordPath</td><td id="value">An expression language statement used to determine how the RecordPath is resolved. The following variables are availible: ${field.name}, ${field.value}, ${field.type}</td><td>The name of each user-defined property must be a valid RecordPath.<br/><strong>Supports Expression Language: false</strong></td></tr></table></p><h3>Relationships: </h3><table id="relationships"><tr><th>Name</th><th>Description</th></tr><tr><td>duplicate</td><td>Records detected as duplicates in the FlowFile content will be routed to this relationship</td></tr><tr><td>non-duplicate</td><td>If the record was not found in the cache, it will be routed to this relationship</td></tr><tr><td>failure</td><td>If unable to communicate with the cache, the FlowFile will be penalized and routed to this relationship</td></tr><tr><td>original</td><td>The original input FlowFile is sent to this relationship unless there is a fatal error in the processing.</td></tr></table><h3>Reads Attributes: </h3>None specified.<h3>Writes Attributes: </h3><table id="writes-attributes"><tr><th>Name</th><th>Description</th></tr><tr><td>record.count</td><td>The number of records processed.</td></tr></table><h3>State management: </h3>This component does not store state.<h3>Restricted: </h3>This component is not restricted.<h3>Input requirement: </h3>This component requires an incoming relationship.<h3>System Resource Considerations:</h3><table id="system-resource-considerations"><tr><th>Resource</th><th>Description</th></tr><tr><td>MEMORY</td><td>The HashSet filter type will grow memory space proportionate to the number of unique records processed. The BloomFilter type will use constant memory regardless of the number of records processed.</td></tr><tr><td>CPU</td><td>If a more advanced hash algorithm is chosen, the amount of time required to hash any particular record could increase substantially.</td></tr></table><h3>See Also:</h3><p><a href="../../../nifi-distributed-cache-services-nar/1.19.1/org.apache.nifi.distributed.cache.client.DistributedMapCacheClientService/index.html">DistributedMapCacheClientService</a>, <a href="../../../nifi-distributed-cache-services-nar/1.19.1/org.apache.nifi.distributed.cache.server.map.DistributedMapCacheServer/index.html">DistributedMapCacheServer</a>, <a href="../org.apache.nifi.processors.standard.DetectDuplicate/index.html">DetectDuplicate</a></p></body></html>