Member since
07-07-2022
42
Posts
2
Kudos Received
8
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
4236 | 07-27-2022 12:05 PM | |
1692 | 07-25-2022 05:01 AM | |
913 | 07-21-2022 02:03 AM | |
2187 | 07-21-2022 01:52 AM | |
1351 | 07-19-2022 10:48 AM |
07-22-2022
09:24 PM
Hi , How to define JSON datatype for any Attribute in Avro schema Registry? Thanks Abhishek Singh
... View more
Labels:
- Labels:
-
Apache NiFi
07-22-2022
09:02 AM
Hi , I want to move source DB data to destination DB. Source db table has 'metadat' column, dataType='JSON'. I am using 'captureChangeMySql' processor to ready the change data from mysql binary-log file and put a data to destination db. 'captureChangeMySql' processor to reading the change data from mysql binary-log file but 'metadat' column, dataType='JSON' , value is showing as some encoded format. 1. Can anyone suggest why JSON datatype value is coming encoded like below? 2. Which format is it encoded and how can we get it back as a JSON data to save at destination db. 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", "external_code" : null, "external_url" : null, "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", "terms" : null, "product_type_id" : 1, "is_perpetual" : null, "sort_order" : "20", "transitional_sort_order" : null, "completion_cert_type" : null, "ecard_cert_type" : null, "ecard_validity" : null, "ecard_name" : null, "is_deleted" : "{}", "created_at" : "Thu Mar 04 13:15:53 IST 2021", "updated_at" : "Thu Mar 04 13:15:53 IST 2021", "created_by" : null, "updated_by" : null, "is_legacy" : "{0}", "has_ce" : "{}", "region" : "CA", "self_registration_override" : "{}", "allow_assignment" : "{0}", "default_license_type" : null, "dispatch_confirmation" : "{}", "multi_package" : "{}" } ] Original data in db: {"mappedProducts": ["20-4040", "20-4041", "20-4042", "20-4043"]}
... View more
Labels:
- Labels:
-
Apache NiFi
07-21-2022
01:52 AM
1 Kudo
After enabling the GTID of mysql service and enabled captureChange mySql processor configuration to "Use Binlog GTID" : true, This issue got resolved. below script to enabled GTID in mysql: SET @@GLOBAL.ENFORCE_GTID_CONSISTENCY = WARN; SET @@GLOBAL.ENFORCE_GTID_CONSISTENCY = ON; SET @@GLOBAL.GTID_MODE = OFF_PERMISSIVE; SET @@GLOBAL.GTID_MODE = ON_PERMISSIVE; After enabling above properties run below query to check status. SHOW STATUS LIKE 'ONGOING_ANONYMOUS_TRANSACTION_COUNT'; If count is 0 then enabled GTID using below query: SET @@GLOBAL.GTID_MODE = ON; To Check the GTID status: select @@GLOBAL.GTID_MODE; select @@GLOBAL.ENFORCE_GTID_CONSISTENCY;
... View more
07-20-2022
04:26 AM
Hi, I want to modify the ddl query table name. I am using the replaceText processor to modify the flowfile query table name. Currently I am able to achieve it because I have one source DB and only one table name I have changed in destination DB. Like sourceDBName: nrpsubscriotion and tableName: status -> destinationDBName: nrpresport and tableName: subscription_status. Now I have two source DB(1. nrpsubscriotion, 2. nrpuserorg) and both have same tableName: status. Now Source DB 2 , tableName in destination DB nrpreport has tableName: user_org_status. I have stuck here , I am not getting how can define a condition to replce a tableName in DDL based on schema name and ddl query able name: It should map like below: 1. SourceDBName: nrpsubscriotion and tableName: status -> destinationDBName: nrpresport and tableName: subscription_status. Flow File input: { "type" : "ddl", "timestamp" : 1658314685000, "binlog_gtidset" : "e75d07af-eb37-11ec-9d1d-a86daa745b08:1-206", "database" : "nrpsubscription", "table_name" : null, "table_id" : null, "query" : "ALTER TABLE `status` ADD COLUMN `is_test` VARCHAR(255) NULL AFTER `code`" } Expected output: { "type" : "ddl", "timestamp" : 1658314685000, "binlog_gtidset" : "e75d07af-eb37-11ec-9d1d-a86daa745b08:1-206", "database" : "nrpsubscription", "table_name" : null, "table_id" : null, "query" : "ALTER TABLE `subscription_status` ADD COLUMN `is_test` VARCHAR(255) NULL AFTER `code`" } 2. SourceDBName: nrpuserorg and tableName: status -> destinationDBName: nrpreport and tableName: user_org_status. { "type" : "ddl", "timestamp" : 1658314686000, "binlog_gtidset" : "e75d07af-eb37-11ec-9d1d-a86daa745b08:1-207", "database" : "nrpuserorg", "table_name" : null, "table_id" : null, "query" : "ALTER TABLE `status` ADD COLUMN `is_test` VARCHAR(255) NULL AFTER `code`" } Expected output: { "type" : "ddl", "timestamp" : 1658314686000, "binlog_gtidset" : "e75d07af-eb37-11ec-9d1d-a86daa745b08:1-207", "database" : "nrpuserorgdb", "table_name" : null, "table_id" : null, "query" : "ALTER TABLE `user_org_status` ADD COLUMN `is_test` VARCHAR(255) NULL AFTER `code`" }
... View more
Labels:
- Labels:
-
Apache NiFi
07-19-2022
10:48 AM
Hi , I have modified Sql statement using replace text processor but still getting below error when I alter a table and add new column. PutDatabaseRecord processor input json: { "type" : "ddl", "timestamp" : 1658252209000, "binlog_gtidset" : "e75d07af-eb37-11ec-9d1d-a86daa745b08:1-147", "database" : "nrpsubscriptiondb2306", "table_name" : null, "table_id" : null, "query" : "ALTER TABLE `nrpreportdb`.`user_org_status` ADD COLUMN `is_test` VARCHAR(255) NULL AFTER `code`" } Error log: Record had no (or null) value for Field Containing SQL: query, FlowFile StandardFlowFileRecord[uuid=bc7d51b3-e71f-4eb2-834b-fecbcff572be,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1658226664320-3, container=default, section=3], offset=37727, length=277],offset=0,name=bc7d51b3-e71f-4eb2-834b-fecbcff572be,size=277]
... View more
07-19-2022
10:32 AM
@rafy Above link is saying that to use one more processor PutSQL before PutDatabaseRecord to execute a statement. We already have PutDatabaseRecord processor to execute statement on db then why we should add putSQL processor? Also other than DDL if any other action(insert, update, delete) will be perform in source db, It will fail because putSql processor will expect sql statement to execute first and based on success next processor will be call. In this case provided link suggestion will not work.
... View more
07-19-2022
05:35 AM
Hi, I want to manipulate below string in updateAttribute processor. I tried replace function etc but it is not working for me. Can anyone suggest to modify below string to change DBName and TableName as per expected output. query = ${query:replace('nrpuserorgdb2306.status', 'nrpreportdb.user_org_status')} query : "ALTER TABLE `nrpuserorgdb2306`.`status` \nADD COLUMN `is_deleted` TINYINT NULL AFTER `code`" Expected output: query : ALTER TABLE `nrpreportdb`.`user_org_status` ADD COLUMN `is_test` TINYINT NULL AFTER `code`
... View more
Labels:
- Labels:
-
Apache NiFi
07-18-2022
12:52 AM
I have configured the NiFi flow file where I am reading mysql binary-log file. for me insert, update and delete flow is working fine but when I alter a table then I am getting error. sourceDBName: nrpsubscriptiondb2306 and tableName: product_types destinationDBName: nrpreportdb and tableName: product_types Alter table nifi error: Record had no (or null) value for Field Containing SQL: query, FlowFile StandardFlowFileRecord[uuid=8ca029c9-70aa-4e53-aec3-d37c15c8cd07,claim=StandardContentClaim [resourceClaim=StandardResourceClaim
... View more
Labels:
- Labels:
-
Apache NiFi
07-17-2022
11:32 PM
@alim, I have implemented the same flow file where I am ready mysql binary-log file. for me insert, update and delete flow is working fine but when I alter a table then I am getting error. sourceDBName: nrpsubscriptiondb2306 and tableName: product_types destinationDBName: nrpreportdb and tableName: product_types Alter table nifi error: Record had no (or null) value for Field Containing SQL: query, FlowFile StandardFlowFileRecord[uuid=8ca029c9-70aa-4e53-aec3-d37c15c8cd07,claim=StandardContentClaim [resourceClaim=StandardResourceClaim
... View more