Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

convertjsontosql generating sql with blank values

avatar
New Contributor

110030-1564043796178.png

AVRO TO JSON produce content like below:


{

"id" : 92,

"title" : "mr",

"first" : "Alvin",

"last" : "Lau"

}



convertjsontosql produce content like below:


INSERT INTO nifi.copysql (id, title, first, last) VALUES (?, ?, ?, ?)


Attached is the convertjsontosql processor setting.

@Matt Burgess please assist

3 REPLIES 3

avatar
Master Guru

@Yogesh Kumar

This is an expected behaviour from ConvertJSONToSql processor and if you want to view the values for columns check flowfile attributes.

Refer to this link for more details regards to similar question

https://community.hortonworks.com/questions/155492/can-someone-tell-me-how-to-update-a-record-in-ora...


Using ConvertJsonToSql is an older approach, instead use PutDatabaseRecord processor and define RecordReader controller service to read the incoming flowfile.

avatar
New Contributor

This is the error if I process the queue with the above content in PuthiiveQL


  1. PutHiveQL[id=89b230de-8dc5-18e0-9cac-668cfe8085b0] Failed to update Hive for StandardFlowFileRecord[uuid=1bb63fbe-29af-4422-b8a3-a282063514e8,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1564127716134-1, container=default, section=1], offset=186312, length=69],offset=0,name=9d11a5b0-78e8-43f1-9514-9e4c4509855c,size=69] due to Error while compiling statement: FAILED: ParseException line 1:58 cannot recognize input near '?' ',' '?' in value row constructor; routing to failure: org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: ParseException line 1:58 cannot recognize input near '?' ',' '?' in value row constructor




avatar
New Contributor

This is the error if I process the queue with the above content in PuthiiveQL

16:11:15 SGT

ERROR

89b230de-8dc5-18e0-9cac-668cfe8085b0


PutHiveQL[id=89b230de-8dc5-18e0-9cac-668cfe8085b0] Failed to update Hive for StandardFlowFileRecord[uuid=1bb63fbe-29af-4422-b8a3-a282063514e8,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1564127716134-1, container=default, section=1], offset=186312, length=69],offset=0,name=9d11a5b0-78e8-43f1-9514-9e4c4509855c,size=69] due to Error while compiling statement: FAILED: ParseException line 1:58 cannot recognize input near '?' ',' '?' in value row constructor; routing to failure: org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: ParseException line 1:58 cannot recognize input near '?' ',' '?' in value row constructor