简体   繁体   中英

Create a stream with a struct key in KSQL

How can I create a KSQL stream with a struct as key?

ksql> CREATE STREAM S1 (k STRUCT<k int> KEY, v VARCHAR) WITH (kafka_topic='s1', partitions=1, key_format='avro', value_format='avro');


ksql> INSERT INTO s1 (k, v) VALUES (STRUCT(k := 1), 'foo');

You can also refer the following doc for dealing with other structured data types - https://docs.ksqldb.io/en/latest/how-to-guides/query-structured-data/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM