[jira] [Commented] (NIFI-4080) ValidateCSV - Add support for Expression Language
[ https://issues.apache.org/jira/browse/NIFI-4080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16356799#comment-16356799 ] ASF subversion and git services commented on NIFI-4080: --- Commit 16e56ccfcacb64c96fb0d46e5ca61973e8ab0adb in nifi's branch refs/heads/master from [~ca9mbu] [ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=16e56cc ] NIFI-4080: Restored customValidate in ValidateCSV for schema property with no EL Signed-off-by: Pierre VillardThis closes #2226. > ValidateCSV - Add support for Expression Language > -- > > Key: NIFI-4080 > URL: https://issues.apache.org/jira/browse/NIFI-4080 > Project: Apache NiFi > Issue Type: Improvement >Reporter: Matt Burgess >Assignee: Matt Burgess >Priority: Major > > The ValidateCSV processor could benefit if the following fields supported > Expression Language evaluation: > - Schema > - Quote character > - Delimiter character > - End of line symbols -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-4080) ValidateCSV - Add support for Expression Language
[ https://issues.apache.org/jira/browse/NIFI-4080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16356804#comment-16356804 ] ASF GitHub Bot commented on NIFI-4080: -- Github user asfgit closed the pull request at: https://github.com/apache/nifi/pull/2226 > ValidateCSV - Add support for Expression Language > -- > > Key: NIFI-4080 > URL: https://issues.apache.org/jira/browse/NIFI-4080 > Project: Apache NiFi > Issue Type: Improvement >Reporter: Matt Burgess >Assignee: Matt Burgess >Priority: Major > > The ValidateCSV processor could benefit if the following fields supported > Expression Language evaluation: > - Schema > - Quote character > - Delimiter character > - End of line symbols -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-4080) ValidateCSV - Add support for Expression Language
[ https://issues.apache.org/jira/browse/NIFI-4080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16356798#comment-16356798 ] ASF subversion and git services commented on NIFI-4080: --- Commit 836c3242587b0246af4a10497dfd8ce90cf642a9 in nifi's branch refs/heads/master from [~ca9mbu] [ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=836c324 ] NIFI-4080: Added EL support to fields in ValidateCSV > ValidateCSV - Add support for Expression Language > -- > > Key: NIFI-4080 > URL: https://issues.apache.org/jira/browse/NIFI-4080 > Project: Apache NiFi > Issue Type: Improvement >Reporter: Matt Burgess >Assignee: Matt Burgess >Priority: Major > > The ValidateCSV processor could benefit if the following fields supported > Expression Language evaluation: > - Schema > - Quote character > - Delimiter character > - End of line symbols -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-4080) ValidateCSV - Add support for Expression Language
[ https://issues.apache.org/jira/browse/NIFI-4080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16356795#comment-16356795 ] ASF GitHub Bot commented on NIFI-4080: -- Github user pvillard31 commented on the issue: https://github.com/apache/nifi/pull/2226 +1 as well, merging to master, thanks guys > ValidateCSV - Add support for Expression Language > -- > > Key: NIFI-4080 > URL: https://issues.apache.org/jira/browse/NIFI-4080 > Project: Apache NiFi > Issue Type: Improvement >Reporter: Matt Burgess >Assignee: Matt Burgess >Priority: Major > > The ValidateCSV processor could benefit if the following fields supported > Expression Language evaluation: > - Schema > - Quote character > - Delimiter character > - End of line symbols -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-4080) ValidateCSV - Add support for Expression Language
[ https://issues.apache.org/jira/browse/NIFI-4080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16356759#comment-16356759 ] ASF GitHub Bot commented on NIFI-4080: -- Github user mgaido91 commented on the issue: https://github.com/apache/nifi/pull/2226 +1, locally it builds and passes all the tests > ValidateCSV - Add support for Expression Language > -- > > Key: NIFI-4080 > URL: https://issues.apache.org/jira/browse/NIFI-4080 > Project: Apache NiFi > Issue Type: Improvement >Reporter: Matt Burgess >Assignee: Matt Burgess >Priority: Major > > The ValidateCSV processor could benefit if the following fields supported > Expression Language evaluation: > - Schema > - Quote character > - Delimiter character > - End of line symbols -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-4080) ValidateCSV - Add support for Expression Language
[ https://issues.apache.org/jira/browse/NIFI-4080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16356293#comment-16356293 ] ASF GitHub Bot commented on NIFI-4080: -- Github user mattyb149 commented on the issue: https://github.com/apache/nifi/pull/2226 Are you comfortable giving a +1 without the other test failures? If so we can get a committer to merge. Thanks to both @mgaido91 and @patricker for improvements. > ValidateCSV - Add support for Expression Language > -- > > Key: NIFI-4080 > URL: https://issues.apache.org/jira/browse/NIFI-4080 > Project: Apache NiFi > Issue Type: Improvement >Reporter: Matt Burgess >Assignee: Matt Burgess >Priority: Major > > The ValidateCSV processor could benefit if the following fields supported > Expression Language evaluation: > - Schema > - Quote character > - Delimiter character > - End of line symbols -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-4080) ValidateCSV - Add support for Expression Language
[ https://issues.apache.org/jira/browse/NIFI-4080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16355187#comment-16355187 ] ASF GitHub Bot commented on NIFI-4080: -- Github user mgaido91 commented on the issue: https://github.com/apache/nifi/pull/2226 thanks @mattyb149. The test failures are not related to this PR. They are caused by 3ca7c3e7a19c7f496a214d9b93ace43b1507c9ec. I am investigating them. I am not sure if it is possible to re-trigger a build for this PR, thanks. > ValidateCSV - Add support for Expression Language > -- > > Key: NIFI-4080 > URL: https://issues.apache.org/jira/browse/NIFI-4080 > Project: Apache NiFi > Issue Type: Improvement >Reporter: Matt Burgess >Assignee: Matt Burgess >Priority: Major > > The ValidateCSV processor could benefit if the following fields supported > Expression Language evaluation: > - Schema > - Quote character > - Delimiter character > - End of line symbols -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-4080) ValidateCSV - Add support for Expression Language
[ https://issues.apache.org/jira/browse/NIFI-4080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16354111#comment-16354111 ] ASF GitHub Bot commented on NIFI-4080: -- Github user mattyb149 commented on the issue: https://github.com/apache/nifi/pull/2226 We don't need to get rid of those tests; rather I think if no EL is present, then we should try parsing the schema for validity. It will be reparsed in onTrigger() anyway (whether it has EL or not). > ValidateCSV - Add support for Expression Language > -- > > Key: NIFI-4080 > URL: https://issues.apache.org/jira/browse/NIFI-4080 > Project: Apache NiFi > Issue Type: Improvement >Reporter: Matt Burgess >Assignee: Matt Burgess >Priority: Major > > The ValidateCSV processor could benefit if the following fields supported > Expression Language evaluation: > - Schema > - Quote character > - Delimiter character > - End of line symbols -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-4080) ValidateCSV - Add support for Expression Language
[ https://issues.apache.org/jira/browse/NIFI-4080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16348709#comment-16348709 ] ASF GitHub Bot commented on NIFI-4080: -- Github user mgaido91 commented on the issue: https://github.com/apache/nifi/pull/2226 @mattyb149 there is a test failure because I just cherry-picked my changes on top of your PR, so when I run the tests, I didn't run the test you added here (sorry, my bad). This test is not valid anymore, since we cannot validate the schema since we have it only when we get the flow files. May you please remove `testValidateWithEL` then please? Thanks. > ValidateCSV - Add support for Expression Language > -- > > Key: NIFI-4080 > URL: https://issues.apache.org/jira/browse/NIFI-4080 > Project: Apache NiFi > Issue Type: Improvement >Reporter: Matt Burgess >Assignee: Matt Burgess >Priority: Major > > The ValidateCSV processor could benefit if the following fields supported > Expression Language evaluation: > - Schema > - Quote character > - Delimiter character > - End of line symbols -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-4080) ValidateCSV - Add support for Expression Language
[ https://issues.apache.org/jira/browse/NIFI-4080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16223411#comment-16223411 ] ASF GitHub Bot commented on NIFI-4080: -- Github user patricker commented on a diff in the pull request: https://github.com/apache/nifi/pull/2226#discussion_r147551737 --- Diff: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ValidateCsv.java --- @@ -227,9 +231,9 @@ public void setPreference(final ProcessContext context) { // input is transferred over to Java as is. So when you type the characters "\" // and "n" into the UI the Java string will end up being those two characters // not the interpreted value "\n". -final String msgDemarcator = context.getProperty(END_OF_LINE_CHARACTER).getValue().replace("\\n", "\n").replace("\\r", "\r").replace("\\t", "\t"); -this.preference.set(new CsvPreference.Builder(context.getProperty(QUOTE_CHARACTER).getValue().charAt(0), - context.getProperty(DELIMITER_CHARACTER).getValue().charAt(0), msgDemarcator).build()); +final String msgDemarcator = context.getProperty(END_OF_LINE_CHARACTER).evaluateAttributeExpressions().getValue().replace("\\n", "\n").replace("\\r", "\r").replace("\\t", "\t"); +this.preference.set(new CsvPreference.Builder(context.getProperty(QUOTE_CHARACTER).evaluateAttributeExpressions().getValue().charAt(0), + context.getProperty(DELIMITER_CHARACTER).evaluateAttributeExpressions().getValue().charAt(0), msgDemarcator).build()); --- End diff -- No concerns. > ValidateCSV - Add support for Expression Language > -- > > Key: NIFI-4080 > URL: https://issues.apache.org/jira/browse/NIFI-4080 > Project: Apache NiFi > Issue Type: Improvement >Reporter: Matt Burgess >Assignee: Matt Burgess > > The ValidateCSV processor could benefit if the following fields supported > Expression Language evaluation: > - Schema > - Quote character > - Delimiter character > - End of line symbols -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (NIFI-4080) ValidateCSV - Add support for Expression Language
[ https://issues.apache.org/jira/browse/NIFI-4080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16222932#comment-16222932 ] ASF GitHub Bot commented on NIFI-4080: -- Github user mattyb149 commented on a diff in the pull request: https://github.com/apache/nifi/pull/2226#discussion_r147526473 --- Diff: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ValidateCsv.java --- @@ -227,9 +231,9 @@ public void setPreference(final ProcessContext context) { // input is transferred over to Java as is. So when you type the characters "\" // and "n" into the UI the Java string will end up being those two characters // not the interpreted value "\n". -final String msgDemarcator = context.getProperty(END_OF_LINE_CHARACTER).getValue().replace("\\n", "\n").replace("\\r", "\r").replace("\\t", "\t"); -this.preference.set(new CsvPreference.Builder(context.getProperty(QUOTE_CHARACTER).getValue().charAt(0), - context.getProperty(DELIMITER_CHARACTER).getValue().charAt(0), msgDemarcator).build()); +final String msgDemarcator = context.getProperty(END_OF_LINE_CHARACTER).evaluateAttributeExpressions().getValue().replace("\\n", "\n").replace("\\r", "\r").replace("\\t", "\t"); +this.preference.set(new CsvPreference.Builder(context.getProperty(QUOTE_CHARACTER).evaluateAttributeExpressions().getValue().charAt(0), + context.getProperty(DELIMITER_CHARACTER).evaluateAttributeExpressions().getValue().charAt(0), msgDemarcator).build()); --- End diff -- That would be more useful, this was initially just a quick addition. There is something funky with unit tests when you call isExpressionLanguagePresent() from a custom validator, it throws an NPE. I will look into that and try to move it into onTrigger(). However if for some reason there is a property that must be evaluated early, or too much overhead in building the CsvPreference (not saying there is, just saying if there is), then I'd rather have all the properties either support flow file attributes or none, how does that sound? > ValidateCSV - Add support for Expression Language > -- > > Key: NIFI-4080 > URL: https://issues.apache.org/jira/browse/NIFI-4080 > Project: Apache NiFi > Issue Type: Improvement >Reporter: Matt Burgess >Assignee: Matt Burgess > > The ValidateCSV processor could benefit if the following fields supported > Expression Language evaluation: > - Schema > - Quote character > - Delimiter character > - End of line symbols -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (NIFI-4080) ValidateCSV - Add support for Expression Language
[ https://issues.apache.org/jira/browse/NIFI-4080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16221830#comment-16221830 ] ASF GitHub Bot commented on NIFI-4080: -- Github user patricker commented on a diff in the pull request: https://github.com/apache/nifi/pull/2226#discussion_r147335687 --- Diff: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ValidateCsv.java --- @@ -227,9 +231,9 @@ public void setPreference(final ProcessContext context) { // input is transferred over to Java as is. So when you type the characters "\" // and "n" into the UI the Java string will end up being those two characters // not the interpreted value "\n". -final String msgDemarcator = context.getProperty(END_OF_LINE_CHARACTER).getValue().replace("\\n", "\n").replace("\\r", "\r").replace("\\t", "\t"); -this.preference.set(new CsvPreference.Builder(context.getProperty(QUOTE_CHARACTER).getValue().charAt(0), - context.getProperty(DELIMITER_CHARACTER).getValue().charAt(0), msgDemarcator).build()); +final String msgDemarcator = context.getProperty(END_OF_LINE_CHARACTER).evaluateAttributeExpressions().getValue().replace("\\n", "\n").replace("\\r", "\r").replace("\\t", "\t"); +this.preference.set(new CsvPreference.Builder(context.getProperty(QUOTE_CHARACTER).evaluateAttributeExpressions().getValue().charAt(0), + context.getProperty(DELIMITER_CHARACTER).evaluateAttributeExpressions().getValue().charAt(0), msgDemarcator).build()); --- End diff -- What do you think of waiting until `onTrigger` to build the CsvPreference so you can also evaluate the FlowFile's attributes when you call `evaluateAttributeExpressions`? Then each you can use broader scoped variables, or variables specified at the FlowFile leve. > ValidateCSV - Add support for Expression Language > -- > > Key: NIFI-4080 > URL: https://issues.apache.org/jira/browse/NIFI-4080 > Project: Apache NiFi > Issue Type: Improvement >Reporter: Matt Burgess >Assignee: Matt Burgess > > The ValidateCSV processor could benefit if the following fields supported > Expression Language evaluation: > - Schema > - Quote character > - Delimiter character > - End of line symbols -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (NIFI-4080) ValidateCSV - Add support for Expression Language
[ https://issues.apache.org/jira/browse/NIFI-4080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16220381#comment-16220381 ] ASF GitHub Bot commented on NIFI-4080: -- GitHub user mattyb149 opened a pull request: https://github.com/apache/nifi/pull/2226 NIFI-4080: Added EL support to fields in ValidateCSV Thank you for submitting a contribution to Apache NiFi. In order to streamline the review of the contribution we ask you to ensure the following steps have been taken: ### For all changes: - [x] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message? - [x] Does your PR title start with NIFI- where is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character. - [x] Has your PR been rebased against the latest commit within the target branch (typically master)? - [x] Is your initial contribution a single, squashed commit? ### For code changes: - [x] Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder? - [x] Have you written or updated unit tests to verify your changes? - [x] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? - [x] If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly? - [x] If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly? - [x] If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties? ### For documentation related changes: - [x] Have you ensured that format looks appropriate for the output in which it is rendered? ### Note: Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible. You can merge this pull request into a Git repository by running: $ git pull https://github.com/mattyb149/nifi NIFI-4080 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/nifi/pull/2226.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2226 commit 6eb80347d833f573df8509e9eb969fc9cc5d64eb Author: Matthew BurgessDate: 2017-10-26T12:27:27Z NIFI-4080: Added EL support to fields in ValidateCSV > ValidateCSV - Add support for Expression Language > -- > > Key: NIFI-4080 > URL: https://issues.apache.org/jira/browse/NIFI-4080 > Project: Apache NiFi > Issue Type: Improvement >Reporter: Matt Burgess >Assignee: Matt Burgess > > The ValidateCSV processor could benefit if the following fields supported > Expression Language evaluation: > - Schema > - Quote character > - Delimiter character > - End of line symbols -- This message was sent by Atlassian JIRA (v6.4.14#64029)