covertJSONtoSQL returning empty values in NiFi

隐身守侯 提交于 2019-12-11 01:35:50

问题


I am designing a work which takes a data from on database in MySQl to another database(MySQL) using ExecuteSQL processor followed up with ConvertAvroToJson then ConvertJsonToSQL then PutSQL as shown in below flow chart

ConvertJSONToSQL returning the empty values like below

 INSERT INTO source_count (field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

The processor configuration is

what can be wrong in this workflow?


回答1:


Besides the answer given in the comments (to use the sql relationship with ConvertJSONToSQL), then if you have at least NiFi 1.2.0, you can replace everything after ExecuteSQL with PutDatabaseRecord. It lets you configure a reader (you would choose an AvroReader that uses the Embedded Schema) and set the operation type to INSERT, and it will handle the SQL generation and execution for you.



来源:https://stackoverflow.com/questions/47693683/covertjsontosql-returning-empty-values-in-nifi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!