NIFI-8761 Enable not setting a value for Escape Character in CSVReade…#5249
NIFI-8761 Enable not setting a value for Escape Character in CSVReade…#5249adenes merged 3 commits intoapache:mainfrom
Conversation
…r controller service
pvillard31
left a comment
There was a problem hiding this comment.
Had a very quick look, looks good to me. Made a quick suggestion. Maybe @pgyori might also want to double check this pull request.
...nifi-record-utils/nifi-standard-record-utils/src/main/java/org/apache/nifi/csv/CSVUtils.java
Outdated
Show resolved
Hide resolved
…tandard-record-utils/src/main/java/org/apache/nifi/csv/CSVUtils.java Co-authored-by: Pierre Villard <pierre.villard.fr@gmail.com>
|
Thanks @pvillard31 for your help, applied your recommendation. |
pgyori
left a comment
There was a problem hiding this comment.
It looks good to me, I only left a minor comment for a suggested name change.
The code looks good.
Tested the functionality and it works as expected.
The documentation is updated correctly and is understandable.
All the newly added code is carefully surrounded with unit tests. Great job!
I found some behavior that is not caused by this modification, but came up for me while testing this. If the input data is:
"abc\def"
and the escape character is not specified (null), I found that in the output we get:
"abc\\def"
It is present in earlier versions of NiFi, and occurs when we select e.g. RFC 4180 as the CSV Format (in the Reader). I think it might be something that is worth fixing since I suppose it is just a side-effect of having to escape backslashes in strings in Java. I'm not sure though, if it should be handled in this PR or a separate one. @timeabarna , @pvillard31 what do you think?
...record-utils/nifi-standard-record-utils/src/main/java/org/apache/nifi/csv/CSVValidators.java
Outdated
Show resolved
Hide resolved
.../nifi-record-serialization-services/src/test/java/org/apache/nifi/csv/TestCSVValidators.java
Outdated
Show resolved
Hide resolved
|
Amending my previous comment: |
|
Thanks @pgyori for your help, I've renamed the validator based on your recommendation. |
pgyori
left a comment
There was a problem hiding this comment.
Thank you @timeabarna !
LGTM +1
|
Thanks @timeabarna for the contribution and @pgyori for the review. Merging to main. |
apache#5249) NIFI-8761 Enable not setting a value for Escape Character in CSVReader controller service Co-authored-by: Pierre Villard <pierre.villard.fr@gmail.com>
…r controller service
https://issues.apache.org/jira/browse/NIFI-8761
Description of PR
Enables to use CSVReader and CSVRecordSetWriter without escape character
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
For all changes:
Is there a JIRA ticket associated with this PR? Is it referenced
in the commit message?
Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
Has your PR been rebased against the latest commit within the target branch (typically
main)?Is your initial contribution a single, squashed commit? Additional commits in response to PR reviewer feedback should be made on this branch and pushed to allow change tracking. Do not
squashor use--forcewhen pushing to allow for clean monitoring of changes.For code changes:
mvn -Pcontrib-check clean installat the rootnififolder?LICENSEfile, including the mainLICENSEfile undernifi-assembly?NOTICEfile, including the mainNOTICEfile found undernifi-assembly?.displayNamein addition to .name (programmatic access) for each of the new properties?For documentation related changes:
Note:
Please ensure that once the PR is submitted, you check GitHub Actions CI for build issues and submit an update to your PR as soon as possible.