Created on 01-11-2020 10:01 AM - last edited on 01-12-2020 05:37 AM by cjervis
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"
}
]
}
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.
Created 01-12-2020 06:52 AM
@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.
Created 01-12-2020 09:53 AM
@stevenmatison: Sure , i got your point.
Csv Reader and Putdatabase Config are given below:
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.