Created
May 2, 2023 05:42
-
-
Save nfarah86/52238e16a0e92b010f4db0ffe0c3734a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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