0
votes

I have two apache-nifi flows. One taken from database and other coming from flowfile.

Taken from QueryDatabaseTableRecord processor. :

lat,long,location
232,3454,colombo
454,8834,kandy
438,94,galle

In my flowfile I have lat and long columns. What I want is compare lat, and long coming from two flows and if its match, add a new column to flowfile as location

The problem I am having is that(to use ExecuteScript), how to get values from both flows as they have identical names?

Or is there a way to use another processor to do this?

1

1 Answers

1
votes

Try LookupRecord with a DatabaseRecordLookupService instead of QueryDatabaseTableRecord. You should specify user-defined properties lat to /lat and long to /long and a Result RecordPath of /location. If the lat/long of the flow file match the lat/long of a database row, it should return the value of location.