Replies: 3 comments
-
|
Hi! Is this the same question: https://stackoverflow.com/questions/78468438/producing-messages-from-clickhouse-materialized-view-to-kafka-topic-by-kafka-eng ? Based on the code implementation, |
Beta Was this translation helpful? Give feedback.
-
|
Hi!
Yes, this is my question.
And thank you for advice. After that I changed type of _key to String it worked for me
On 13 May 2024, at 5:07, yiyang-shao ***@***.***> wrote:
Hi!
Is this the same question: https://stackoverflow.com/questions/78468438/producing-messages-from-clickhouse-materialized-view-to-kafka-topic-by-kafka-eng ?
Based on the code implementation, _key column needs to be a String type. You may try to convert to string using toString() or using some other String type column.
—
Reply to this email directly, view it on GitHub<#63669 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A6QFX7JOJHWEZ6J7M3JHOIDZCAN6RAVCNFSM6AAAAABHSZ377GVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TIMJSGM2TM>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
|
Beta Was this translation helpful? Give feedback.
-
|
From current source code KafkaProducer.cpp:27-34 — on construction, scans the block header: if there's a column named _key and it's String, it records that column's index. KafkaProducer.cpp:52-57 — on produce(), if that index is set, extracts that column's value at the row position and passes it to builder.key(...) → that's the Kafka message key. StorageKafka.cpp:267 — the header is getSampleBlockNonMaterialized(), i.e., regular columns including _key. So _key participates in BOTH the producer's key handling AND the format serialization of the value. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
I am sinking data from table to kafka topic with materialized view by Kafka table engine. It sends data as KafkaRecord that has value but key=null.
How can I populate key in KafkaRecord?
Beta Was this translation helpful? Give feedback.
All reactions