[
https://issues.apache.org/jira/browse/NIFI-7510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17127447#comment-17127447
]
Shane Downey commented on NIFI-7510:
------------------------------------
Hi Mark, thanks for that quick and detailed response. What i'm building is a
flow to extract data based on a source file that is human created - so if the
query returns 0 rows I want to route those to an error file so that someone can
manually verify the data.
I'll give your suggestion of routing directly to PutFile and see how we go. At
the end of the day I need all successful query results to be output to a single
file hence the MergeRecords processor.
Thanks again
Shane
> MergeRecords not working after RouteOnAttribute
> -----------------------------------------------
>
> Key: NIFI-7510
> URL: https://issues.apache.org/jira/browse/NIFI-7510
> Project: Apache NiFi
> Issue Type: Bug
> Affects Versions: 1.11.4
> Environment: MS Windows 10
> Reporter: Shane Downey
> Priority: Minor
>
> Here's the scenario:
> I need to process an arbitrary length spreadsheet or CSV file.
> For each row in the file, I need to extract a value from a column called
> "Key" and pass it into a SQL Query. If the query returns 0 rows I need to
> write the source "Key" into an exception file.
> For the successful queries, I need to write the full output to a spreadsheet
> file.
>
> Setup:
> GetFile-->ConvertExceltoCSVProcessor-->SplitRecord(CSVReader/JSONRecordSetWriter)->
> ExtractText("Key"/Value)-->UpdateAttribute("arg.1"=value)->
> ExecuteSQLRecord()-->RouteOnAttribute(rowcount=0)->LogAttribute
> RouteOnAttribute(rowcount!=0)-->MergeRecords(Defragment)->PutFile
>
> In the above scenario, the FlowFile blocks in the queue leading into
> MergeRecords (never actually makes it into MergeRecords).
>
> If I change the merge strategy to Bin then data does flow through to the
> output file in "chunks" of rows.
> If I remove RouteOnAttribute from the flow, the solution works as expected
> and my output file is created as expected.
>
> Thus - there appears to be an issue using RouteOnAttribute within a
> SplitRecord/MergeRecord block and using the defragment merge strategy.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)