Skip to content

Instantly share code, notes, and snippets.

@nfarah86
Created May 2, 2023 05:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nfarah86/52238e16a0e92b010f4db0ffe0c3734a to your computer and use it in GitHub Desktop.
Save nfarah86/52238e16a0e92b010f4db0ffe0c3734a to your computer and use it in GitHub Desktop.
set sql-client.execution.result-mode=tableau;
-- create the datagen table
CREATE TABLE sourceT (
uuid varchar(20),
name varchar(10),
age int,
ts timestamp(3)
) WITH (
'connector' = 'datagen',
'rows-per-second' = '200'
);
-- create the hudi table
CREATE TABLE hudiT(
uuid VARCHAR(20) PRIMARY KEY NOT ENFORCED,
name VARCHAR(10),
age INT,
ts TIMESTAMP(3),
`partition` VARCHAR(20)
)
PARTITIONED BY (`partition`)
WITH (
'connector' = 'hudi',
'path' = '${work_path}/hudi-demo/hudiT',
'write.tasks' = '2'
);
insert into hudi_T select uuid, name, age, ts, 'par1' from sourceT;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment