- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Facing ERROR: invalid input syntx for integer:"" while processing NiFI flow file
- Labels:
-
Apache NiFi
-
NiFi Registry
Created on
03-16-2020
06:44 PM
- last edited on
03-16-2020
09:54 PM
by
VidyaSargur
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello guys,
I am extracting attributes from the flow file and putting it to the PostgreSQL.
2017-04-27 09:15:04.794761 10.69.1.138 -> 10.69.1.100 <4>Apr 27 03:44:58 kernel: [ 542.579606] TS|242268|00:14:5a:03:29:72|RSSI_BCN|56
2017-04-27 09:47:59.351047 10.69.1.138 -> 10.69.1.100 <4>Apr 27 04:17:43 kernel: [ 2517.159922] TS|2216852|00:14:5a:03:23:01|RSSI_BCN|53
- I am trying to extract integer value 56,53... end of the line and put it to the column<col> of PostgreSQL table<tab> where the <col>datatype is integer.
- I used GetFile->SplitText->ExtractText ->putSQL in my process flow.
- I used (\d*)\z regular expression in ExtractText processor and its seems working well for extracting the value 56. But after a certain time the putSQL processor shows error ERROR: invalid input syntx for integer:"".
- If I change the datatype from integer -> text in the <col> of my PostgreSQL table then I don't face this problem but I need to store the data in integer.
- So can anyone please help me on finding the root cause of it, or what can I do to resolve it?
Created 03-17-2020 10:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello all,
The problem has been resolved.
- First, I ingested the all the attributes as a text in the PostgreSQL table.
- Then converted the text data to integer type with flowing command.
ALTER TABLE public."tab"
ALTER COLUMN col type int using nullif(col,'')::int
Hope this will be helpful for others.
Created 03-17-2020 10:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello all,
The problem has been resolved.
- First, I ingested the all the attributes as a text in the PostgreSQL table.
- Then converted the text data to integer type with flowing command.
ALTER TABLE public."tab"
ALTER COLUMN col type int using nullif(col,'')::int
Hope this will be helpful for others.