ChrisSamo632 commented on PR #7441:
URL: https://github.com/apache/nifi/pull/7441#issuecomment-1683405494

   > How do you test different errors in a NiFi instance (not a unit test)? 
Given the Operation I can only generate one kind of error at a time. This looks 
good though, just want to verify I can get groups of errors then I'll merge
   
   @mattyb149 my suggestion (although I'll not be in a position to try it for a 
while), would be to create an index with a numeric field mapping, index a 
document with a known id, then run the processor in update mode with 2 records 
- 1 with a mismatched id (should result in a not_found error), the 2nd with the 
correct id but a non-numeric value for the numeric field (should give a "format 
exception")
   
   From memory, this is the kind of thing I've tried to show in the 
unit/integration tests
   
   This could possibly all be done with a single FlowFile and run off the 
processor - the index operation can be set by the value of a field within a 
record. So something like:
   
   1. Op=index, id=1, fields: foo="bar", baz=1
   2. Op=update, id=unknown, fields: foo="zap"
   3. Op=update, id=1, fields: baz="not a number"
   
   Index=bulk_test, Index Op record path=/Op, id record path=/id
   
   That's a chance Elasticsearch will set the "baz" fields mapping to string by 
default, but hopefully it'll choose Integer. If so, we'll need to separately 
define the index mappings and pre-create the index with an InvokeHTTP call (for 
example). If you don't get to it first, I'll try to put a Flow Definition 
together and attach it to the jira ticket as an example


-- 
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