turcsanyip commented on a change in pull request #3504: NIFI-6318: Support EL
in CSV formatting properties
URL: https://github.com/apache/nifi/pull/3504#discussion_r291544194
##########
File path:
nifi-nar-bundles/nifi-extension-utils/nifi-record-utils/nifi-standard-record-utils/src/main/java/org/apache/nifi/csv/CSVUtils.java
##########
@@ -97,9 +105,10 @@
.build();
public static final PropertyDescriptor ESCAPE_CHAR = new
PropertyDescriptor.Builder()
.name("Escape Character")
- .description("The character that is used to escape characters that
would otherwise have a specific meaning to the CSV Parser.")
+ .description("The character that is used to escape characters that
would otherwise have a specific meaning to the CSV Parser. If the property has
been specified via Expression Language " +
+ "but the expression gets evaluated to an invalid Escape
Character at runtime, then it will be skipped and the default Escape Character
will be used.")
.addValidator(new CSVValidators.SingleCharacterValidator())
Review comment:
No idea why there are two types of single character validators (furthermore
SingleCharacterValidator also calls a kind of unescaping...).
I tried to find it out but in the end I decided to keep the existing logic
in order not to affect the existing flow configs (backward compatibility).
We could use the illegal characters for Value Separator too, because \n and
\r are not legal separators for CSV.
For unescaping I would use the one from Commons Text.
With these changes we could merge the 2 validators, however there is a
chance of incompatibility (very low though).
Keeping one validator and deleting the other one would also affect 3rd party
/ custom components that might use these validators. Do we consider these
validators as part of our public api that should not be changed / deleted? Or
can we simply modify them?
@ijokarumawak : If you think it is acceptable, I will refactor the
validators.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services