View Revisions: Issue #6872

Summary 0006872: Add a JSON transform type
Revision 2025-05-14 21:08 by pbelov
Steps To Reproduce Create two different tables with the same name:
(assuming PostgreSQL syntax)

1. On the source node:
CREATE TABLE demo.demo4json(
    id INTEGER NOT NULL,
    name varchar(20) NOT NULL,
    PRIMARY KEY (id)
);

2. On the target node:
CREATE TABLE demo.demo4json(
    id INTEGER NOT NULL,
    payload jsonb NOT NULL,
    PRIMARY KEY (id)
);

3. Set up JSON transform on EXCRACT & SPECIFIED:
INSERT INTO sym_transform_table
(transform_id, source_node_group_id, target_node_group_id, transform_point, source_catalog_name, source_schema_name, source_table_name, target_catalog_name, target_schema_name, target_table_name, update_first, update_action, delete_action, transform_order, column_policy, create_time, last_update_by, last_update_time, description)
VALUES('demo4json', 'lab27pg17source', 'lab27pg17target', 'EXTRACT', '', 'demo', 'demo4json', NULL, 'demo', 'demo4json', 0, 'UPD_ROW', 'DEL_ROW', 0, 'SPECIFIED', '2025-05-14 16:44:23.905', 'no_user', '2025-05-14 16:47:41.791', 'JSON test');


INSERT INTO sym_transform_column
(transform_id, include_on, target_column_name, source_column_name, pk, transform_type, transform_expression, transform_order, create_time, last_update_by, last_update_time, description)
VALUES('demo4json', '*', 'id', 'id', 1, 'copy', NULL, 0, '2025-05-14 16:42:50.024', 'no_user', '2025-05-14 16:42:50.023', NULL)
, VALUES('demo4json', '*', 'payload', NULL, 0, 'json', '', 1, '2025-05-14 16:42:50.022', 'no_user', '2025-05-14 16:42:50.022', NULL);

4. Insert test data at the source:
 INSERT INTO demo.demo4json (id, name) VALUES(1, 'name1');

5. Observe data on the target:
  select * from demo.demo4json;
id | payload
1 | {"id": "1", "name": "3"}
Revision 2025-05-06 18:03 by emiller
Steps To Reproduce