Support Questions

Find answers, ask questions, and share your expertise

None of the fields in the JSON map to the columns defined by the table] Failed to convert {} to a SQL {} statement due to {}; routing to failure

avatar
New Contributor

I'm trying to convert some json data into sql using ConvertJSONToSQL
json data is randomly streaming like this :

{
    "results": [
        {
            "user": {
                "gender": "male",
                "name": {
                    "title": "mr",
                    "first": "loan",
                    "last": "dupuis"
                },
                "location": {
                    "street": "5271 rue de l'abbaye",
                    "city": "besançon",
                    "state": "ardennes",
                    "zip": 73670
                },
                "email": "loan.dupuis@example.com",
                "username": "whitelion878",
                "password": "cunts",
                "salt": "xYxY1ETQ",
                "md5": "cb6012a530de93542a1b38ac634fa8aa",
                "sha1": "161e4cbda7833771e0e7a661176c7cf4ff46dde8",
                "sha256": "4fe5472e0caaf1172a01c3f7f21700a0c06648b8e562acd4f068509a3d6e9ee9",
                "registered": 1032769152,
                "dob": 896683885,
                "phone": "04-38-39-01-49",
                "cell": "06-16-62-08-41",
                "INSEE": "1980646267293 37",
                "picture": {
                    "large": "https://randomuser.me/api/portraits/men/44.jpg",
                    "medium": "https://randomuser.me/api/portraits/med/men/44.jpg",
                    "thumbnail": "https://randomuser.me/api/portraits/thumb/men/44.jpg"
                }
            }
        }
    ],
    "nationality": "FR",
    "seed": "efe577b03676759907",
    "version": "0.8"
}


 But getting error like : 
2022-12-08 13:23:26,694 ERROR [Timer-Driven Process Thread-10] o.a.n.p.standard.ConvertJSONToSQL [ConvertJSONToSQL[id=e7a7e5bc-0184-1000-3380-708ff6caf86e], StandardFlowFileRecord[uuid=e7494f4d-4849-414e-ba14-20a231fb47a4,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1670505805613-370, container=default, section=370], offset=3756, length=1252],offset=0,name=5161d27a-d3de-4d46-b2f7-12c8188256c1,size=1252], INSERT, org.apache.nifi.processor.exception.ProcessException: None of the fields in the JSON map to the columns defined by the NIFI_DB.Results table] Failed to convert {} to a SQL {} statement due to {}; routing to failure
org.apache.nifi.processor.exception.ProcessException: None of the fields in the JSON map to the columns defined by the NIFI_DB.Results table
at org.apache.nifi.processors.standard.ConvertJSONToSQL.generateInsert(ConvertJSONToSQL.java:525)
at org.apache.nifi.processors.standard.ConvertJSONToSQL.onTrigger(ConvertJSONToSQL.java:391)
at org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
at org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1354)
at org.apache.nifi.controller.tasks.ConnectableTask.invoke(ConnectableTask.java:246)
at org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:102)
at org.apache.nifi.engine.FlowEngine$2.run(FlowEngine.java:110)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)

 

I have just created a table in Mysql with a single column and want to dump this data into it, dont want to create multiple colums in this table, just raw data. Please have a look  

0 REPLIES 0