sejal-gupta-ksolves opened a new pull request, #11833:
URL: https://github.com/apache/nifi/pull/11833

   # Summary
   
   [NIFI-15274](https://issues.apache.org/jira/browse/NIFI-15274)
   
   `LookupAttribute` can only set a single value per lookup, because it 
requires a `StringLookupService`. Enriching a FlowFile with several fields from 
the same record means running one lookup per attribute.
   
   This adds `LookupMultipleAttributes`, which uses a `RecordLookupService` to 
do one lookup and set several FlowFile attributes from the returned Record:
   
   - **Lookup Service**: a `RecordLookupService` that requires exactly one key 
(e.g. `DatabaseRecordLookupService`)
   - **Lookup Key**: the value to look up, supports FlowFile attribute 
Expression Language
   - **Include Empty Values**: if true, null or blank fields are added as empty 
attributes. If false, they are skipped
   - **Dynamic properties**: attribute name -> field name in the returned Record
   - **Relationships**: `matched` (at least one attribute added), `unmatched` 
(no record, or no attribute added), `failure` (lookup error)
   
   No lookup service changes are needed, and `LookupAttribute` is unchanged.
   
   # Verification
   
   - [x] Build completed using `./mvnw -Pcontrib-check verify -pl 
nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors`
   - [x] Unit tests: `TestLookupMultipleAttributes` (match, unmatched, empty 
values included and excluded, lookup failure, validation)
   - [x] Manually tested in a running NiFi with `DatabaseRecordLookupService` 
and `GenerateFlowFile`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to