[ https://issues.apache.org/jira/browse/NIFI-5060?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16434468#comment-16434468 ]
Pierre Villard commented on NIFI-5060: -------------------------------------- Hi [~ioneethling], welcome in the NiFi community and thanks for having a look at how to contribute. I'd suggest you to have a look at the documentation on this subject: [https://cwiki.apache.org/confluence/display/NIFI/Contributor+Guide] Also, if you pick a Jira you want to work on, I'd recommend ensuring no one is working on it yet. For this one you can see that a pull request is already opened. However you're more than welcome to help reviewing the PR by giving it a try and commenting/sharing your thoughts on the Github PR page. For NIFI-4908, there is also existing PRs, and I'm sure we'd highly appreciate help to review the new processors. For NIFI-4517, best is to discuss your thoughts on the Jira if you're not sure how to proceed, otherwise you can go ahead and submit a PR on github. > UpdateRecord substringAfter and substringAfterLast only increments by 1 > ----------------------------------------------------------------------- > > Key: NIFI-5060 > URL: https://issues.apache.org/jira/browse/NIFI-5060 > Project: Apache NiFi > Issue Type: Bug > Components: Extensions > Affects Versions: 1.6.0 > Reporter: Chris Green > Priority: Major > Labels: easyfix, newbie > Attachments: Validate_substringafter_Behavior.xml > > > This is my first submitted issue, so please feel free to point me in the > correct direction if I make process mistakes. > Replication: > Drag a GenerateFlowFile onto the canvas and configure this property, and set > run schedule to some high value like 600 seconds > "Custom Text" \{"value": "01230123"} > Connect GenerateFlowFile with an UpdateAttribute set to add the attribute > "avro.schema" with a value of > > {code:java} > { > "type": "record", > "name": "test", > "fields" : [{"name": "value", "type": "string"}] > } > {code} > > > Connect UpdateAttribute to an UpdateRecord onto the canvas, Autoterminate > success and failure. Set the Record Reader to a new JSONTreeReader. On the > JsonTreeReader configure it to use the "Use 'Schema Text' Attribute". > Create a JsonRecordSetWriter and set the Schema Text to: > > > {code:java} > { > "type": "record", > "name": "test", > "fields" : [ > {"name": "value", "type": "string"}, > {"name": "example1", "type": "string"}, > {"name": "example2", "type": "string"}, > {"name": "example3", "type": "string"}, > {"name": "example4", "type": "string"} > ] > } > {code} > > Add the following properties to UpdateRecord > > ||Heading 1||Heading 2|| > |/example1|substringAfter(/value, "1") | > |/example2|substringAfter(/value, "123") | > |/example3|substringAfterLast(/value, "1")| > |/example4|substringAfterLast(/value, "123")| > > Resulting record currently: > > {code:java} > [{ > "value" : "01230123", > "example1" : "230123", > "example2" : "30123", > "example3" : "23", > "example4" : "3" > }] > {code} > > > > Problem: > When using the UpdateRecord processor, and the substringAfter() function > after the search phrase is found it will only increment the substring > returned by 1 rather than the length of the search term. > Based off XPath and other implementations of substringAfter functions I've > seen the value returned should remove the search term rather than just the > first character of the search term. > > > Resulting record should be: > > {code:java} > [{ > "value" : "01230123", > "example1" : "230123", > "example2" : "0123", > "example3" : "23", > "example4" : "" > }] > {code} > > > I'm cleaning up a fix with test code that will change the increment from 1 to > the length of the search terms. > It appears substringBefore are not impacted by the behavior as always returns > the index before the found search term which is the expected behavior -- This message was sent by Atlassian JIRA (v7.6.3#76005)