問題描述
我正在設(shè)計(jì)一項(xiàng)工作,它使用 ExecuteSQL 處理器將數(shù)據(jù)從 MySQl 中的數(shù)據(jù)庫傳輸?shù)搅硪粋€(gè)數(shù)據(jù)庫(MySQL),然后是 ConvertAvroToJson,然后是 ConvertJsonToSQL然后PutSQL如下流程圖
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 返回如下所示的空值
INSERT INTO source_count (field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
處理器配置為
這個(gè)工作流程有什么問題?
what can be wrong in this workflow?
推薦答案
除了評(píng)論中給出的答案(使用與 ConvertJSONToSQL 的 sql 關(guān)系),那么如果你至少有 NiFi 1.2.0,你可以在之后替換所有內(nèi)容使用 PutDatabaseRecord.它允許您配置閱讀器(您可以選擇 AvroReader 使用Embedded Schema)并將操作類型設(shè)置為INSERT,它將處理SQL為您生成和執(zhí)行.
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.
這篇關(guān)于covertJSONtoSQL 在 NiFi 中返回空值的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!