Krutik Gadhiya
08/07/2023, 11:52 AMCREATE TABLE CPU_IN (hostname STRING,
cpu STRING,
usage DOUBLE,
occurred_at BIGINT,
time_ltz AS TO_TIMESTAMP_LTZ(occurred_at, 3),
WATERMARK FOR time_ltz AS time_ltz - INTERVAL '10' SECONDS
) WITH (
'connector' = 'kafka',
'properties.bootstrap.servers' = 'localhost:9092',
'topic' = 'cpu_load',
'value.format' = 'json',
'properties.group.id' = 'testGroup',
'scan.startup.mode' = 'latest-offset'
);
CREATE TABLE CPU_OUT_AGG (
window_start TIMESTAMP(3),
window_end TIMESTAMP(3),
hostname STRING,
cpu STRING,
usage_avg DOUBLE
) WITH (
'connector' = 'kafka',
'topic-pattern' = 'SINK_TABLE',
'properties.bootstrap.servers' = 'localhost:9092',
'topic' = 'cpu_out',
'value.format' = 'json',
'properties.group.id' = 'testGroup',
'scan.startup.mode' = 'latest-offset'
);Brian Koehler
08/09/2023, 5:26 PMflink-sql-connector-* jars instead. Notice the -sql- in the name. This is a fat jar used for both DataStream and Table APIsBrian Koehler
08/09/2023, 5:26 PMKrutik Gadhiya
08/11/2023, 7:14 AM