how to insert the whole json record(as a single json string) in NiFi flow file into json column of database

  Kiến thức lập trình

I am using NiFi to load data from database A in json record format and want to insert json record into a json column of database B.

A => ExecuteSQLRecord => [jsonRow,...] => [?] => B.table(data json)

which processor should I use at the position [?]. I tried jolt and PutDatabaseRecord, but failed:

...[jsonRow,...] => jolt =>[{data:jsonRow},...]=> PutDatabaseRecord => B.Table(data json)

I got error:
Batch entry 0 insert into schema.table(data) values((‘MapRecord [{…}]’)) was aborted: ERROR: invalid input syntax for type json Detail: Token “MapRecord” is invalid. Where: JSON data, line 1: MapRecord… unnamed portal parameter $1 = ‘…’ Call getNextException to see other errors in the batch.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT