Support Questions

Find answers, ask questions, and share your expertise

NIFI || Putdatabaserecord processor error ||Insertion to database failing

avatar
Contributor

Hi All,

 

I want to insert csv data (which is getting generated from executsql) to database table.

csv header are same as that of columns in table:

 

TIME timestamp,
CAUSE varchar(200) NOT NULL,
CATEGORY varchar(100),
PREVIOUSCOUNT numeric(11,0),
CURRENTCOUNT numeric(11,0),
AVERAGE numeric(11,3),
SEVERITY varchar(30)

 

My current flow is like :

 

Executesql > updateattribute > validatecsv > updateattribute > putdatabase

 

I am using avroschemaregistry and putting data as:

{
"type":"record",
"name":"TestRecord",
"fields":[
{
"name":"TIME",
"type":{"type":"long","logicalType":"timestamp-millis"}
},
{
"name":"CAUSE",
"type":"string"
},
{
"name":"CATEGORY",
"type":"string"
},
{
"name":"PREVIOUSCOUNT",
"type":"float"
},
{
"name":"CURRENTCOUNT",
"type":"float"
},
,
{
"name":"AVERAGE",
"type":"float"
},
,
{
"name":"SEVERITY",
"type":"string"
}
]
}

 

Insertion Issue1.pngInsertion Issue2.png

 

 

Please help  as i am stuck , i tried everything making translate field name to true and false both, but getting the same error.

 

Looking for quick response. 

 

2 REPLIES 2

avatar
Super Guru

@ashishtiw26  Can you show us the configuration of the CSVReader Controller Service, the PutDatabaseRecord Processor, and sample of the contents of a FlowFile before PutDatabaseRecord.

 

Contributors need to see as much information as possible in order to trouble shoot specific error messages.

 

 

avatar
Contributor

@stevenmatison: Sure , i got your point.

 

Csv Reader and Putdatabase Config are given below:

 

CSVREADER config.pngputdatabase config.png

 

Sample of content of Flowfile before putdatabase is as below:

 

TIME,CAUSE,CATEGORY,PREVIOUSCOUNT,CURRENTCOUNT,AVERAGE,SEVERITY
2020-01-10 20:10:00,UNABLE TO COMPLY,DIAMETER: Permanent Failure,1172,1150,686,MAJOR
2020-01-10 20:10:00,Unspecified,NAS,15071,15240,13533,MINOR.

 

Thanks for replying.