Github user markap14 commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2088#discussion_r138178130
--- Diff:
nifi-nar-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/main/java/org/apache/nifi/csv/SingleCharacterValidator.java
---
@@ -31,10 +31,23 @@
illegalChars.add("\n");
}
+ boolean allowEmpty = false;
+
+ public SingleCharacterValidator(boolean allowEmpty) {
+ this.allowEmpty = allowEmpty;
+ }
+
@Override
public ValidationResult validate(final String subject, final String
input, final ValidationContext context) {
final String unescaped = CSVUtils.unescape(input);
- if (unescaped.length() != 1) {
+ if (allowEmpty && unescaped.length() > 1) {
--- End diff --
This logic doesn't seem to be exactly right. If allowEmpty == true and
unescaped.length() is 0, then this 'if clause' evaluates to false. So we will
go to the next line, and unescaped.length() == 0 so it's invalid. As a result,
when I tried to set Quote Character to empty string, the processor is invalid.
---