准备数据:
添加源数据表incremental_source
MySQL代码如下:
create table `incremental_source` (
`id` int (20),
`name` varchar (60),
`age` int (20),
`create_time` datetime
);
insert into `incremental_source` (`id`, `name`, `age`, `create_time`) values('1','Isabella','18','2019-08-20 13:14:20');
insert into `incremental_source` (`id`, `name`, `age`, `create_time`) values('2','Jack','20','2019-08-21 13:14:21');
insert into `incremental_source` (`id`, `name`, `age`, `create_time`) values('3','Nicholas','22','2019-08-20 13:14:22');
insert into `incremental_source` (`id`, `name`, `age`, `create_time`) values('4','Jasmine','19','2019-08-20 13:14:23');
insert into `incremental_source` (`id`, `name`, `age`, `create_time`) values('5','Mia','20','2019-08-20 13:14:24');
添加目标数据表incremental_target
MySQL代码如下:
create table `incremental_target` (
`id` int (20),
`name` varchar (60),
`age` int (20),
`create_time` datetime
);
insert into `incremental_target_copy` (`id`, `name`, `age`, `create_time`) values('1','Isabella','18','2019-08-20 13:14:20');
insert into `incremental_target_copy` (`id`, `name`, `age`, `create_time`) values('2','Jack','20','2019-08-21 13:14:21');
insert into `incremental_target_copy` (`id`, `name`, `age`, `create_time`) values('3','Nicholas','22','2019-08-20 13:14:22');
insert into `incremental_target_copy` (`id`, `name`, `age`, `create_time`) values('4','Jasmine','19','2019-08-20 13:14:23');
insert into `incremental_target_copy` (`id`, `name`, `age`, `create_time`) values('5','Mia','20','2019-08-20 13:14:24');
打开kettle工具,创建转换incremental_load,并添加如下控件及Hop跳连接线
配置“插入/更新”控件
修改源数据表中数据,新增第六行数据,将第二行数据的age修改为25
运行转换incremental_load并查看目标表