gpt4 book ai didi

apache-kafka - 如何在 Select 语句中选择记录的键

转载 作者:行者123 更新时间:2023-12-04 04:12:21 26 4
gpt4 key购买 nike

我创建了这条记录:

new ProducerRecord(topic = "petstore-msg-topic", key = msg.username, value = s"${msg.route},${msg.time}")

我现在想做这样的事情:

CREATE STREAM petstorePages (KEY, route VARCHAR, time VARCHAR) \
WITH (KAFKA_TOPIC='petstore-msg-topic', VALUE_FORMAT='DELIMITED');

是否有可能在 Stream 创建中访问 key ,或者我是否必须在值中也包含 key ?

最佳答案

它是自动添加的,叫做ROWKEY

KSQL adds the implicit columns ROWTIME and ROWKEY to every stream and table, which represent the corresponding Kafka message timestamp and message key

https://docs.confluent.io/current/ksql/docs/syntax-reference.html#id16

关于apache-kafka - 如何在 Select 语句中选择记录的键,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51925142/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com