Created on 06-06-2019 07:58 PM - edited 08-17-2019 03:05 PM
I am trying to do UPSERT on hbase using PUTDATABASERECORD processor.
For this I am preparing UPSERT query using UPDATERECORD processor
My UPDATE RECORD processor settings are like this.
In this one I have added one more field called query
value of query is : concat('UPSERT INTO myschema.Parameter("DSN","LEGACYID","INTDATE","PARAMETERDATA")values(\'',/DSN,'\',',/legacyID,',\'',/intDate,'\',\'',/parameterData,'\')')
The last field(parameterData) referred above is of type array.
When the UPDATE RECORD processor runs my query is generated. In the query generated find I can find something called 'MapRecord[' for the parameterData which is mentioned above.
Each array item is enclosed in a MapRecord. Is this something done by UpdateRecord processor?
Is there any way to avoid this?
It would be great if someone can guide me to avoid/fix this.
Thanks
Jithesh
Created 12-03-2021 02:22 AM
This is an old issue but however, recently I had the same problem using the LookupRecord processor.
In my case it is due to retrieving data from the LookupRecord in which the first records appears to be null. Hence NiFi is unable to create the correct schema for this data (settings 'Inherit schema' in reader). As a result when a record with valid data is processed, NiFi seems to wrap it inside 'MapRecord'.
The solution is to put the valid schema in the AvroSchemeRegistry, and provide it to the reader in your processor.
Created on 12-03-2021 06:19 AM - edited 12-03-2021 06:20 AM
i was troubleshooting this exact issue yesterday, and the fact that you posted this 4 hours ago on an unanswered question from 2.5 years ago is world class. thanks so much, @BartDPvliz !
Created 09-22-2023 07:47 AM
Same problem, but this did not help me. The solution for me was found on stackoverflow. Change the Result RecordPath in the LookupRecord processor to a single forward slash. https://stackoverflow.com/questions/49674048/apache-nifi-hbase-lookup