Created 02-22-2018 04:45 PM
Hi There,
I am trying to lookup records from a CSV file using LookupRecord and SimpleCsvFileLookupService but I am unable to get the final record with both values. Please find below details.
Input File
ID, Name 1,Elon 2,Mark 3,Jeff
Lookup File
ID,Company 1,Tesla 2,Facebook 3,Amazon
Expected Output
ID,Name,Company 1,Elon,Tesla 2,Mark,Facebook 3,Jeff,Amazon
AvroSchema
{ "name": "ceodata", "namespace": "nifi", "type": "record", "fields": [ { "name": "ID", "type": "string" }, { "name": "NAME", "type": "string" }, { "name": "COMPANY", "type": "string" } ] }
LookupRecord Processor Config
CSVReader Config
CSVWriter Config
LookupFromCSVFileService
Please let me know what's wrong in these configurations.
@jfrazee @Bryan Bende @Abdelkrim Hadjidj @Timothy Spann @Aldrin Piri
Created 02-22-2018 05:09 PM
Hi @spdvnz
Your input and output CSV schema for the LookupRecord should be different. In the output schema you should add a field 'Company' that the processor will populate.
Take a look at this example where I added the field city in the output schema : https://medium.com/@abdelkrim.hadjidj/data-flow-enrichment-with-apache-nifi-d221f1dde419
Created 02-22-2018 05:16 PM
If that is your output schema, then the Result RecordPath in LookupRecord should be /COMPANY not /Company.
Created on 02-22-2018 06:04 PM - edited 08-17-2019 06:57 PM
Thanks for replying @Abdelkrim Hadjidj @Matt Burgess. Now I have two different schemas for input and output CSV for LookupRecord. I modified Result RecordPath to /COMPANY. When I start LookupRecord it takes in 6 flow files but doesn't return anything.