Skip to content

Instantly share code, notes, and snippets.

@BugenZhao
Created May 17, 2023 09:41
Show Gist options
  • Save BugenZhao/45e890ce5baf4d9bd81f32d991799b6c to your computer and use it in GitHub Desktop.
Save BugenZhao/45e890ce5baf4d9bd81f32d991799b6c to your computer and use it in GitHub Desktop.
Kafka Simple Test
kafka-topics --create --bootstrap-server localhost:29092 --replication-factor 1 --partitions 4 --topic my-topic
create table t1 (v1 int, v2 varchar, t timestamptz as proctime()) with (
connector = 'kafka',
topic = 'my-topic',
properties.bootstrap.server = '127.0.0.1:29092',
scan.startup.mode = 'earliest'
) row format json;
create source s1 (v1 int, v2 varchar, t timestamptz as proctime()) with (
connector = 'kafka',
topic = 'my-topic',
properties.bootstrap.server = '127.0.0.1:29092',
scan.startup.mode = 'earliest'
) row format json;
kafka-console-producer --broker-list localhost:29092 --topic my-topic
>{"v1":1, "v2":"hello"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment