Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 11-15-2018 09:46 PM
updaterecord-config-exception.jpgI am trying to replace square bracket symbol [ with parenthesis symbol ( in my employeeName column in my csvReader structure with below syntax
replaceRegex(/employeeName, "[\\[]", "(")
Processor is throwing following exception.
RecordPathException: java.util.regex.PatternSyntaxException: Unclosed character class near index 4 [\\[]
same regular expression compiled successfully using java method java.util.regex.Pattern.compile method.
replaceRegex is working fine for other special characters such as {, <, ", _, - etc.
Please see the attachment for more details.
Any help is greatly appreciated.
Regards,
RK
Created 11-15-2018 10:14 PM
As a work around Instead of using replaceRegex function use replace function with below configs:
UpdateRecord Configs:
Replacement Value Strategy
Record Path Value
/employeeName
replace(/employeeName,'[','(')(or)
If you are updating only one column value then
Replacement Value Strategy
Literal Value
/employeeName
${field.value:replaceAll('\\[','(')}
Created 11-15-2018 10:14 PM
As a work around Instead of using replaceRegex function use replace function with below configs:
UpdateRecord Configs:
Replacement Value Strategy
Record Path Value
/employeeName
replace(/employeeName,'[','(')(or)
If you are updating only one column value then
Replacement Value Strategy
Literal Value
/employeeName
${field.value:replaceAll('\\[','(')}
Created 11-15-2018 10:23 PM
Your suggestion worked. Thank you Shu for promptly addressing my issue.
Created 11-15-2018 11:06 PM
looke like issue in NiFi. created Jira ticket for it