[jira] [Commented] (NIFI-5382) ConvertRecord 1.7.0 - Creates emtpy Flow File
[ https://issues.apache.org/jira/browse/NIFI-5382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16538948#comment-16538948 ] ASF subversion and git services commented on NIFI-5382: --- Commit 624bbab8f06cf8e49c6229d8a2473a429548fcac in nifi's branch refs/heads/master from patricker [ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=624bbab ] NIFI-5382 ConvertRecord Add Option To Drop 0 Record Files NIFI-5382 ConvertRecord Add Option To Drop 0 Record Files Signed-off-by: Matthew Burgess This closes #2853 > ConvertRecord 1.7.0 - Creates emtpy Flow File > - > > Key: NIFI-5382 > URL: https://issues.apache.org/jira/browse/NIFI-5382 > Project: Apache NiFi > Issue Type: New Feature > Components: Extensions >Affects Versions: 1.7.0 >Reporter: Stefan Goldener >Assignee: Peter Wicks >Priority: Minor > Attachments: ConvertRecordBUG.xml > > > The Nifi ConvertRecord Processor does create an empty flow file in case the > input is a CSV with Header but no content. If no content is available the > flow file should be ignored or at least there should be an option to ignore > empty files. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-5382) ConvertRecord 1.7.0 - Creates emtpy Flow File
[ https://issues.apache.org/jira/browse/NIFI-5382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16538947#comment-16538947 ] ASF subversion and git services commented on NIFI-5382: --- Commit 624bbab8f06cf8e49c6229d8a2473a429548fcac in nifi's branch refs/heads/master from patricker [ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=624bbab ] NIFI-5382 ConvertRecord Add Option To Drop 0 Record Files NIFI-5382 ConvertRecord Add Option To Drop 0 Record Files Signed-off-by: Matthew Burgess This closes #2853 > ConvertRecord 1.7.0 - Creates emtpy Flow File > - > > Key: NIFI-5382 > URL: https://issues.apache.org/jira/browse/NIFI-5382 > Project: Apache NiFi > Issue Type: New Feature > Components: Extensions >Affects Versions: 1.7.0 >Reporter: Stefan Goldener >Assignee: Peter Wicks >Priority: Minor > Attachments: ConvertRecordBUG.xml > > > The Nifi ConvertRecord Processor does create an empty flow file in case the > input is a CSV with Header but no content. If no content is available the > flow file should be ignored or at least there should be an option to ignore > empty files. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-5382) ConvertRecord 1.7.0 - Creates emtpy Flow File
[ https://issues.apache.org/jira/browse/NIFI-5382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16538946#comment-16538946 ] ASF GitHub Bot commented on NIFI-5382: -- Github user mattyb149 commented on the issue: https://github.com/apache/nifi/pull/2853 +1 LGTM, ran build with unit tests and contrib-check, and tried various readers/writers, verified the behavior is as intended. Thanks for this improvement! Merging to master > ConvertRecord 1.7.0 - Creates emtpy Flow File > - > > Key: NIFI-5382 > URL: https://issues.apache.org/jira/browse/NIFI-5382 > Project: Apache NiFi > Issue Type: New Feature > Components: Extensions >Affects Versions: 1.7.0 >Reporter: Stefan Goldener >Assignee: Peter Wicks >Priority: Minor > Attachments: ConvertRecordBUG.xml > > > The Nifi ConvertRecord Processor does create an empty flow file in case the > input is a CSV with Header but no content. If no content is available the > flow file should be ignored or at least there should be an option to ignore > empty files. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-5382) ConvertRecord 1.7.0 - Creates emtpy Flow File
[ https://issues.apache.org/jira/browse/NIFI-5382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16538950#comment-16538950 ] ASF GitHub Bot commented on NIFI-5382: -- Github user asfgit closed the pull request at: https://github.com/apache/nifi/pull/2853 > ConvertRecord 1.7.0 - Creates emtpy Flow File > - > > Key: NIFI-5382 > URL: https://issues.apache.org/jira/browse/NIFI-5382 > Project: Apache NiFi > Issue Type: New Feature > Components: Extensions >Affects Versions: 1.7.0 >Reporter: Stefan Goldener >Assignee: Peter Wicks >Priority: Minor > Attachments: ConvertRecordBUG.xml > > > The Nifi ConvertRecord Processor does create an empty flow file in case the > input is a CSV with Header but no content. If no content is available the > flow file should be ignored or at least there should be an option to ignore > empty files. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-5382) ConvertRecord 1.7.0 - Creates emtpy Flow File
[ https://issues.apache.org/jira/browse/NIFI-5382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16538915#comment-16538915 ] ASF GitHub Bot commented on NIFI-5382: -- Github user mattyb149 commented on a diff in the pull request: https://github.com/apache/nifi/pull/2853#discussion_r201413683 --- Diff: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestConvertRecord.java --- @@ -62,6 +62,44 @@ public void testSuccessfulConversion() throws InitializationException { out.assertContentEquals("header\nJohn Doe,48\nJane Doe,47\nJimmy Doe,14\n"); } +@Test +public void testDropEmpty() throws InitializationException { --- End diff -- I tried a couple writers, but at the very least the record delimiter is output, so it appears you still get a record even if it doesn't have any fields. This is good as it stands, thanks! > ConvertRecord 1.7.0 - Creates emtpy Flow File > - > > Key: NIFI-5382 > URL: https://issues.apache.org/jira/browse/NIFI-5382 > Project: Apache NiFi > Issue Type: New Feature > Components: Extensions >Affects Versions: 1.7.0 >Reporter: Stefan Goldener >Assignee: Peter Wicks >Priority: Minor > Attachments: ConvertRecordBUG.xml > > > The Nifi ConvertRecord Processor does create an empty flow file in case the > input is a CSV with Header but no content. If no content is available the > flow file should be ignored or at least there should be an option to ignore > empty files. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-5382) ConvertRecord 1.7.0 - Creates emtpy Flow File
[ https://issues.apache.org/jira/browse/NIFI-5382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16537465#comment-16537465 ] ASF GitHub Bot commented on NIFI-5382: -- Github user patricker commented on the issue: https://github.com/apache/nifi/pull/2853 Updated, additional test not written; suggestions on which Record Reader will make this easy? > ConvertRecord 1.7.0 - Creates emtpy Flow File > - > > Key: NIFI-5382 > URL: https://issues.apache.org/jira/browse/NIFI-5382 > Project: Apache NiFi > Issue Type: New Feature > Components: Extensions >Affects Versions: 1.7.0 >Reporter: Stefan Goldener >Assignee: Peter Wicks >Priority: Minor > Attachments: ConvertRecordBUG.xml > > > The Nifi ConvertRecord Processor does create an empty flow file in case the > input is a CSV with Header but no content. If no content is available the > flow file should be ignored or at least there should be an option to ignore > empty files. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-5382) ConvertRecord 1.7.0 - Creates emtpy Flow File
[ https://issues.apache.org/jira/browse/NIFI-5382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16537461#comment-16537461 ] ASF GitHub Bot commented on NIFI-5382: -- Github user patricker commented on a diff in the pull request: https://github.com/apache/nifi/pull/2853#discussion_r201124899 --- Diff: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestConvertRecord.java --- @@ -62,6 +62,44 @@ public void testSuccessfulConversion() throws InitializationException { out.assertContentEquals("header\nJohn Doe,48\nJane Doe,47\nJimmy Doe,14\n"); } +@Test +public void testDropEmpty() throws InitializationException { --- End diff -- This is probably possible with the write record reader configuration. I tried building a test using Json Row Record Reader, but even if none of the elements in your schema match the schema of the source record it just outputs a NULL for you... ```Successfully converted 2 records for FlowFile[0,627269493239800.mockFlowFile,119B] valuated JSONPath Expression com.jayway.jsonpath.JsonPath@5b8d184c but the path was not found; will use a null value Evaluated JSONPath Expression com.jayway.jsonpath.JsonPath@5b8d184c but the path was not found; will use a null value Successfully converted 2 records for FlowFile[1,627271185518617.mockFlowFile,23B]``` > ConvertRecord 1.7.0 - Creates emtpy Flow File > - > > Key: NIFI-5382 > URL: https://issues.apache.org/jira/browse/NIFI-5382 > Project: Apache NiFi > Issue Type: New Feature > Components: Extensions >Affects Versions: 1.7.0 >Reporter: Stefan Goldener >Assignee: Peter Wicks >Priority: Minor > Attachments: ConvertRecordBUG.xml > > > The Nifi ConvertRecord Processor does create an empty flow file in case the > input is a CSV with Header but no content. If no content is available the > flow file should be ignored or at least there should be an option to ignore > empty files. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-5382) ConvertRecord 1.7.0 - Creates emtpy Flow File
[ https://issues.apache.org/jira/browse/NIFI-5382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16537390#comment-16537390 ] ASF GitHub Bot commented on NIFI-5382: -- Github user mattyb149 commented on a diff in the pull request: https://github.com/apache/nifi/pull/2853#discussion_r201109263 --- Diff: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractRecordProcessor.java --- @@ -99,6 +108,8 @@ public void onTrigger(final ProcessContext context, final ProcessSession session final RecordReaderFactory readerFactory = context.getProperty(RECORD_READER).asControllerService(RecordReaderFactory.class); final RecordSetWriterFactory writerFactory = context.getProperty(RECORD_WRITER).asControllerService(RecordSetWriterFactory.class); +final boolean dropEmptyFiles = context.getProperty(DROP_EMPTY_FILES).isSet()? --- End diff -- Checkstyle violation here, the question mark should be on the next line (or the whole expression on one line) > ConvertRecord 1.7.0 - Creates emtpy Flow File > - > > Key: NIFI-5382 > URL: https://issues.apache.org/jira/browse/NIFI-5382 > Project: Apache NiFi > Issue Type: New Feature > Components: Extensions >Affects Versions: 1.7.0 >Reporter: Stefan Goldener >Assignee: Peter Wicks >Priority: Minor > Attachments: ConvertRecordBUG.xml > > > The Nifi ConvertRecord Processor does create an empty flow file in case the > input is a CSV with Header but no content. If no content is available the > flow file should be ignored or at least there should be an option to ignore > empty files. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-5382) ConvertRecord 1.7.0 - Creates emtpy Flow File
[ https://issues.apache.org/jira/browse/NIFI-5382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16537379#comment-16537379 ] ASF GitHub Bot commented on NIFI-5382: -- Github user mattyb149 commented on a diff in the pull request: https://github.com/apache/nifi/pull/2853#discussion_r201105948 --- Diff: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestConvertRecord.java --- @@ -62,6 +62,44 @@ public void testSuccessfulConversion() throws InitializationException { out.assertContentEquals("header\nJohn Doe,48\nJane Doe,47\nJimmy Doe,14\n"); } +@Test +public void testDropEmpty() throws InitializationException { --- End diff -- I think it's possible to have a ConvertRecord scenario where there are valid records coming in, but the conversion produces no records (no fields match the schema, e.g.), @markap14 do you know if that's possible or if an error would occur? If it is possible, it would be nice to have a unit test that covers that. > ConvertRecord 1.7.0 - Creates emtpy Flow File > - > > Key: NIFI-5382 > URL: https://issues.apache.org/jira/browse/NIFI-5382 > Project: Apache NiFi > Issue Type: New Feature > Components: Extensions >Affects Versions: 1.7.0 >Reporter: Stefan Goldener >Assignee: Peter Wicks >Priority: Minor > Attachments: ConvertRecordBUG.xml > > > The Nifi ConvertRecord Processor does create an empty flow file in case the > input is a CSV with Header but no content. If no content is available the > flow file should be ignored or at least there should be an option to ignore > empty files. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-5382) ConvertRecord 1.7.0 - Creates emtpy Flow File
[ https://issues.apache.org/jira/browse/NIFI-5382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16537378#comment-16537378 ] ASF GitHub Bot commented on NIFI-5382: -- Github user mattyb149 commented on a diff in the pull request: https://github.com/apache/nifi/pull/2853#discussion_r201105301 --- Diff: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractRecordProcessor.java --- @@ -64,6 +64,15 @@ .required(true) .build(); +static final PropertyDescriptor DROP_EMPTY_FILES = new PropertyDescriptor.Builder() +.name("drop-empty-files") +.displayName("Drop Files With No Records") --- End diff -- I agree with Joe's point, whether he means it makes sense to have such a property to filter out 0 record files, or that this new property should be consistent in naming and behavior with the one added to QueryRecord. Right now this new property has inverse naming/behavior from the QueryRecord one, should we use a copy of the QueryRecord one here instead? > ConvertRecord 1.7.0 - Creates emtpy Flow File > - > > Key: NIFI-5382 > URL: https://issues.apache.org/jira/browse/NIFI-5382 > Project: Apache NiFi > Issue Type: New Feature > Components: Extensions >Affects Versions: 1.7.0 >Reporter: Stefan Goldener >Assignee: Peter Wicks >Priority: Minor > Attachments: ConvertRecordBUG.xml > > > The Nifi ConvertRecord Processor does create an empty flow file in case the > input is a CSV with Header but no content. If no content is available the > flow file should be ignored or at least there should be an option to ignore > empty files. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-5382) ConvertRecord 1.7.0 - Creates emtpy Flow File
[ https://issues.apache.org/jira/browse/NIFI-5382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16535580#comment-16535580 ] ASF GitHub Bot commented on NIFI-5382: -- Github user joewitt commented on the issue: https://github.com/apache/nifi/pull/2853 makes sense to be consistent with https://github.com/patricker/nifi/blob/f234f0b2e654027dcaa7e72acfd0f3d035377bae/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/QueryRecord.java#L131 > ConvertRecord 1.7.0 - Creates emtpy Flow File > - > > Key: NIFI-5382 > URL: https://issues.apache.org/jira/browse/NIFI-5382 > Project: Apache NiFi > Issue Type: New Feature > Components: Extensions >Affects Versions: 1.7.0 >Reporter: Stefan Goldener >Assignee: Peter Wicks >Priority: Minor > Attachments: ConvertRecordBUG.xml > > > The Nifi ConvertRecord Processor does create an empty flow file in case the > input is a CSV with Header but no content. If no content is available the > flow file should be ignored or at least there should be an option to ignore > empty files. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (NIFI-5382) ConvertRecord 1.7.0 - Creates emtpy Flow File
[ https://issues.apache.org/jira/browse/NIFI-5382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16535307#comment-16535307 ] ASF GitHub Bot commented on NIFI-5382: -- GitHub user patricker opened a pull request: https://github.com/apache/nifi/pull/2853 NIFI-5382 ConvertRecord Add Option To Drop 0 Record Files ### 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: - [ ] 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? - [ ] 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)? - [ ] If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly? - [ ] If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly? - [ ] If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties? ### For documentation related changes: - [ ] 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/patricker/nifi NIFI-5382 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/nifi/pull/2853.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 #2853 commit f234f0b2e654027dcaa7e72acfd0f3d035377bae Author: patricker Date: 2018-07-06T20:16:11Z NIFI-5382 ConvertRecord Add Option To Drop 0 Record Files > ConvertRecord 1.7.0 - Creates emtpy Flow File > - > > Key: NIFI-5382 > URL: https://issues.apache.org/jira/browse/NIFI-5382 > Project: Apache NiFi > Issue Type: New Feature > Components: Extensions >Affects Versions: 1.7.0 >Reporter: Stefan Goldener >Assignee: Peter Wicks >Priority: Minor > Attachments: ConvertRecordBUG.xml > > > The Nifi ConvertRecord Processor does create an empty flow file in case the > input is a CSV with Header but no content. If no content is available the > flow file should be ignored or at least there should be an option to ignore > empty files. -- This message was sent by Atlassian JIRA (v7.6.3#76005)