CovertJSONtoSQL在NiFi中返回空值 [英] covertJSONtoSQL returning empty values in NiFi
问题描述
我正在设计一个工作,该工作使用 ExecuteSQL 处理器将MySQl中的数据库中的数据传输到另一个数据库(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 返回空值,如下所示:
ConvertJSONToSQL returning the empty values like below
INSERT INTO source_count (field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
处理器配置为
此工作流程可能出什么问题?
what can be wrong in this workflow?
推荐答案
除了注释中给出的答案(要在ConvertJSONToSQL中使用sql关系),如果您至少具有NiFi 1.2.0,则可以在之后替换所有内容使用使用嵌入式架构的avroReader ),并将操作类型设置为INSERT,它将处理SQL为您生成和执行.
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.
这篇关于CovertJSONtoSQL在NiFi中返回空值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!