You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nifi.apache.org by Abhishek Singh <sn...@gmail.com> on 2022/08/08 09:51:20 UTC

Re: How to decode, encoded data read by 'captureChangeMySql' processor in NiFi

Hi,

Can anyone suggest how to handle mysql json datatype binlog data in NiFi.

Thanks,

On Thu, Jul 28, 2022 at 7:37 PM Abhishek Singh <sn...@gmail.com>
wrote:

> Hi Team ,
>
> I want to move source DB data to destination DB. Source db table has a
> 'metadat' column, dataType='JSON'. I am using the 'captureChangeMySql'
> processor to ready the change data from  mysql binary-log file and put the
> data to destination db.
>
> 'captureChangeMySql' processor to read the change data from  mysql
> binary-log file but 'metadata' column, dataType='JSON' , value is showing
> as some encoded format.
>
>
>
> *Can anyone suggest, how to decode, encoded data read by
> 'captureChangeMySql' processor flowfile output using any other NiFi
> processor?*
>
>
> Please advise on this issue.
>
>
>
> *Original data in db: *
>
> *{"mappedProducts": ["20-4040", "20-4041", "20-4042", "20-4043"]}*
>
>
> *Flowfile output:*
>
> [ {
> "id" : 18,
> "name" : "Transitional Licenses - Provider",
> "external_id" : "101",
> "product_tag" : null,
> "tenant_id" : 1,
> *"metadata" :
> "\u0000\u0001\u0000I\u0000\u000B\u0000\u000E\u0000\u0002\u0019\u0000mappedProducts\u0004\u00000\u0000\f\u0010\u0000\f\u0018\u0000\f
> \u0000\f(\u0000\u000720-4040\u000720-4041\u000720-4042\u000720-4043",*
> "duration_in_days" : null,
> "offline_completion_duration" : null,
> "product_code" : "cps_provider_7_ed",
> "short_description" : "This course is for Providers",
> "long_description" : "This course is for Providers",
> "meta_keyword" : null,
> "meta_description" : null,
> "meta_title" : null,
> "status" : "Active",
> "event_type" : "ESSENTIALS",
> "event_participation_type" : "REGISTER_ILE",
> "product_type_id" : 1,
> "sort_order" : "20",
> "is_deleted" : "{}",
> "created_at" : "Thu Mar 04 13:15:53 IST 2021",
> "updated_at" : "Thu Mar 04 13:15:53 IST 2021",
> "is_legacy" : "{0}",
> "has_ce" : "{}",
> "region" : "CA",
> "self_registration_override" : "{}",
> "allow_assignment" : "{0}",
> "dispatch_confirmation" : "{}",
> "multi_package" : "{}"
> } ]
>
>
> Thanks,
>
> Abhishek Singh
>
>