Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

NIFI-JSONTOSQL - None of the fields map to sql

NIFI-JSONTOSQL - None of the fields map to sql

New Contributor

Hi,


I have a csv file with header. I need to put this data into sql

Requirement: Different files with different headers in same input folder


My Approach : GetFile --> ConvertRecord(CSVTOJSon)--> JSONToSql

Issue: Error is thrown at JSONToSQL stating that none of the json fileds map to the table.

Sample Data after converting to JSON from CSV:

[ {

"EMPLID" : "10008026",

"ADDRESS_TYPE" : "HOME",

"EFFDT" : "2017-07-01",

"EFF_STATUS" : "A",

"COUNTRY" : "USA",

"ADDRESS1" : "645 SUMNER WAY",

"ADDRESS2" : "UNIT 6",

"ADDRESS3" : null,

"ADDRESS4" : null,

"CITY" : "OCEANSIDE",

"HOUSE_TYPE" : null,

"COUNTY" : null,

"STATE" : "CA",

"POSTAL" : "92058",

"REG_REGION" : null,

"LASTUPDDTTM" : "2019-04-24 08:51:28.000000",

"LASTUPDOPRID" : "UC_CCATHRO",

"CR_BT_DTM" : "2019-05-23 15:50:41.685596",

"CR_BT_NBR" : "500000",

"UPD_BT_DTM" : "2019-05-23 15:50:41.685596",

"UPD_BT_NBR" : "500000",

"ODS_VRSN_NBR" : "206",

"DML_IND" : "I"

}

]


Error Screenshot is attached:

109689-jsontosql-nifi-error.png

Thanks,

Khaja