[ 
https://issues.apache.org/jira/browse/NIFI-8446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gardella Juan Pablo updated NIFI-8446:
--------------------------------------
    Description: 
I have a simple flow which query a mongo collection with defined as:

{noformat}
clients={_id: ObjectID, id: integer}
{noformat}
And I want to store that output to Postgres table {{clients}} defined as {{_id: 
varchar(24), id: integer}}.

Exception:
{noformat}
2021-04-20 08:33:44,546 ERROR [Timer-Driven Process Thread-4] 
o.a.n.p.standard.PutDatabaseRecord 
PutDatabaseRecord[id=a7b8d415-ac9b-36f0-bf0e-56296bfa5b30] Failed to put 
Records to database for 
StandardFlowFileRecord[uuid=f17fdeca-ef7e-41ad-ab40-bedba3981b75,claim=StandardContentClaim
 [resourceClaim=StandardResourceClaim[id=1618918416018-3, container=default, 
section=3], offset=2, 
length=435013],offset=0,name=8e0b55c5-cab3-4eab-bf7f-40c9ef0442d0,size=435013]. 
Routing to failure.: java.lang.NumberFormatException: For input string: 
"6052e6f8ee02d84b96ba6633"
java.lang.NumberFormatException: For input string: "6052e6f8ee02d84b96ba6633"
        at 
java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
        at java.lang.Integer.parseInt(Integer.java:580)
        at java.lang.Integer.parseInt(Integer.java:615)
        at 
org.apache.nifi.serialization.record.util.DataTypeUtils.toInteger(DataTypeUtils.java:1594)
        at 
org.apache.nifi.serialization.record.util.DataTypeUtils.convertType(DataTypeUtils.java:200)
        at 
org.apache.nifi.serialization.record.util.DataTypeUtils.convertType(DataTypeUtils.java:153)
        at 
org.apache.nifi.serialization.record.util.DataTypeUtils.convertType(DataTypeUtils.java:149)
        at 
org.apache.nifi.processors.standard.PutDatabaseRecord.executeDML(PutDatabaseRecord.java:709)
        at 
org.apache.nifi.processors.standard.PutDatabaseRecord.putToDatabase(PutDatabaseRecord.java:841)
        at 
org.apache.nifi.processors.standard.PutDatabaseRecord.onTrigger(PutDatabaseRecord.java:487)
        at 
org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
        at 
org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1173)
        at 
org.apache.nifi.controller.tasks.ConnectableTask.invoke(ConnectableTask.java:214)
        at 
org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:117)
        at org.apache.nifi.engine.FlowEngine$2.run(FlowEngine.java:110)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
{noformat}

The flow simply uses {{GetMongoRecord}} -> {{PutDatabaseRecord}}. This flow 
worked fine until Nifi 1.12.1 and it is not working on 1.13.2. It tries to 
convert {{_id}} to integer.

Tickets that touches  {{PutDatabaseRecord}} since 1.12.1 are: NIFI-8237, 
NIFI-8223, NIFI-8172, NIFI-8142, NIFI-8023, NIFI-8146, NIFI-8031.

  was:
I have a simple flow which query a mongo collection with defined as:

{noformat}
clients={_id: ObjectID, id: integer}
{noformat}
And I want to store that output to Postgres table {{clients}} defined as {{_id: 
varchar(24), id: integer}}.

The flow simply uses {{GetMongoRecord}} -> {{PutDatabaseRecord}}. This flow 
worked fine until Nifi 1.12.1 and it is not working on 1.13.2. It tries to 
convert {{_id}} to integer.

Tickets that touches  {{PutDatabaseRecord}} since 1.12.1 are: NIFI-8237, 
NIFI-8223, NIFI-8172, NIFI-8142, NIFI-8023, NIFI-8146, NIFI-8031.


> PutDabaseRecord is not mapping properly the columns
> ---------------------------------------------------
>
>                 Key: NIFI-8446
>                 URL: https://issues.apache.org/jira/browse/NIFI-8446
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>    Affects Versions: 1.13.2
>            Reporter: Gardella Juan Pablo
>            Priority: Major
>
> I have a simple flow which query a mongo collection with defined as:
> {noformat}
> clients={_id: ObjectID, id: integer}
> {noformat}
> And I want to store that output to Postgres table {{clients}} defined as 
> {{_id: varchar(24), id: integer}}.
> Exception:
> {noformat}
> 2021-04-20 08:33:44,546 ERROR [Timer-Driven Process Thread-4] 
> o.a.n.p.standard.PutDatabaseRecord 
> PutDatabaseRecord[id=a7b8d415-ac9b-36f0-bf0e-56296bfa5b30] Failed to put 
> Records to database for 
> StandardFlowFileRecord[uuid=f17fdeca-ef7e-41ad-ab40-bedba3981b75,claim=StandardContentClaim
>  [resourceClaim=StandardResourceClaim[id=1618918416018-3, container=default, 
> section=3], offset=2, 
> length=435013],offset=0,name=8e0b55c5-cab3-4eab-bf7f-40c9ef0442d0,size=435013].
>  Routing to failure.: java.lang.NumberFormatException: For input string: 
> "6052e6f8ee02d84b96ba6633"
> java.lang.NumberFormatException: For input string: "6052e6f8ee02d84b96ba6633"
>         at 
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
>         at java.lang.Integer.parseInt(Integer.java:580)
>         at java.lang.Integer.parseInt(Integer.java:615)
>         at 
> org.apache.nifi.serialization.record.util.DataTypeUtils.toInteger(DataTypeUtils.java:1594)
>         at 
> org.apache.nifi.serialization.record.util.DataTypeUtils.convertType(DataTypeUtils.java:200)
>         at 
> org.apache.nifi.serialization.record.util.DataTypeUtils.convertType(DataTypeUtils.java:153)
>         at 
> org.apache.nifi.serialization.record.util.DataTypeUtils.convertType(DataTypeUtils.java:149)
>         at 
> org.apache.nifi.processors.standard.PutDatabaseRecord.executeDML(PutDatabaseRecord.java:709)
>         at 
> org.apache.nifi.processors.standard.PutDatabaseRecord.putToDatabase(PutDatabaseRecord.java:841)
>         at 
> org.apache.nifi.processors.standard.PutDatabaseRecord.onTrigger(PutDatabaseRecord.java:487)
>         at 
> org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
>         at 
> org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1173)
>         at 
> org.apache.nifi.controller.tasks.ConnectableTask.invoke(ConnectableTask.java:214)
>         at 
> org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:117)
>         at org.apache.nifi.engine.FlowEngine$2.run(FlowEngine.java:110)
>         at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>         at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
>         at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
>         at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
>         at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>         at java.lang.Thread.run(Thread.java:748)
> {noformat}
> The flow simply uses {{GetMongoRecord}} -> {{PutDatabaseRecord}}. This flow 
> worked fine until Nifi 1.12.1 and it is not working on 1.13.2. It tries to 
> convert {{_id}} to integer.
> Tickets that touches  {{PutDatabaseRecord}} since 1.12.1 are: NIFI-8237, 
> NIFI-8223, NIFI-8172, NIFI-8142, NIFI-8023, NIFI-8146, NIFI-8031.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to