CREATE TABLE sourceT (
uuid varchar(20),
name varchar(10),
age int,
ts timestamp(3),
`partition` varchar(20)
) WITH (
'connector' = 'datagen',
'rows-per-second' = '1'
);
create table t2(
uuid varchar(20),
name varchar(10),
age int,
ts timestamp(3),
`partition` varchar(20)
)
with (
'connector' = 'hudi',
'path' = '$HUDI_DEMO/t2', -- $HUDI_DEMO 替换成的绝对路径
'table.type' = 'MERGE_ON_READ',
'write.bucket_assign.tasks' = '2',
'write.tasks' = '2',
'hive_sync.enable' = 'true',
'hive_sync.mode' = 'hms',
'hive_sync.metastore.uris' = 'thrift://ip:9083' -- ip 替换成 HMS 的地址
);
insert into t2 select * from sourceT;
参考
hudi快速入门