Member since
10-25-2024
3
Posts
2
Kudos Received
0
Solutions
10-30-2024
08:10 AM
For reference, I tried solution #1 where I added an UpdateAttribute processor and deleted any references to SQL attributes. That did it. Thanks!
... View more
10-28-2024
02:36 PM
1 Kudo
Here is the overall data flow. The second and third processors aren't relevant to the issue, but I'll just leave them there. The group to the upper right, highlighted in the yellow box, is just something I added to help debug the issue. The 'PutSQL' is copy/pasted from the one at the bottom of the screen. When the whole process ran, the one at the bottom, would fail. But I could then start the cloned one, that had not traversed through the 'Data Uploader' process group, and would work successfully. The PutSQL's configuration: And the 'Data Upload' Process Group settings: Let me know if you need more. Thanks.
... View more
10-25-2024
02:46 PM
1 Kudo
I am running into an issue where I am unable to successfully use a PutSQL or ExecuteSQL after returning from a Batch Processor group. The general scenario is this: I need to watch a folder for files that will be created with information to be uploaded to a PostgreSQL database. The files will have multiple lines, each line is to be inserted as a separate record into a temporary/staging table. When all the records from that file have been uploaded, I need to call a stored procedure that will process all those records and update other permanent tables all at once. I came across the concept of using a processor group set with 'Process Group Outbound Policy' set to 'Batch Output'. So, I am able to use GetFile to get each file as it is produced, then pass it into my batch processor group, where it splits the lines into individual flow files, and performs the inserts into my staging table. That all works perfectly. I then use a MergeContent processor to reduce those split files back into a single flow file, so I can subsequently use either ExecuteSQL or PutSQL to call my stored procedure - once. But I then receive an error stating, "Failed to update database for FlowFile[filename=MYFILE.TXT] due to The column index is out of range: 1, number of columns: 0.; it is possible that retrying the operation will succeed, so routing to retry: org.postgresql.util.PSQLException: The column index is out of range: 1, number of columns: 0." The strange thing is that it doesn't matter what SQL statement I am trying to use, whether a 'CALL' to my stored procedure, or a SELECT statement to any table, I get the exact same error. I also tried a test to immediately use a PutSQL to insert records to another test table, after returning from the process group, prior to the MergeContent processor, so that's not the issue either. Even more strange is that I can take the same SQL processor(s) and wire it into the flow prior to the batch process group, and it works just fine. I have other SQL-related processors at the main level, plus the PutSQL processor within the Processor Group that performs each individual insert, and they all work fine. And they all use the same JDBC Connection Pool. So what's the issue? Do I have something misconfigured? Is something not getting passed in and out of the Process Group? Or, considering I'm am using NiFi version 2.0.0-M4, is there a bug somewhere? Thanks.
... View more
Labels:
- Labels:
-
Apache NiFi