Тёмный

ksqlDB HOWTO: Split and Merge Kafka Topics 

Robin Moffatt
Подписаться 4,2 тыс.
Просмотров 3,5 тыс.
50% 1

Using ksqlDB you can split streams of data in Apache Kafka based on values in a field. You can also merge separate streams of data together into one.
ksqlDB uses SQL to describe the stream processing that you want to do. For example:
Splitting a stream:
CREATE STREAM ORDERS_UK
AS SELECT * FROM ORDERS WHERE COUNTRY='UK';
CREATE STREAM ORDERS_OTHER
AS SELECT * FROM ORDERS WHERE COUNTRY!='UK';
Merging streams
CREATE STREAM INVENTORY_COMBINED
AS SELECT 'WH1' AS SOURCE, * FROM INVENTORY_WH1;
CREATE STREAM INVENTORY_COMBINED
AS SELECT 'WH2' AS SOURCE, * FROM INVENTORY_WH2;
-----
💾 Run ksqlDB yourself: ksqldb.io?.devx_ch.rmoff_youtube_5NoU7D4OGA0&
☁️ Use ksqlDB as a managed service: www.confluent.io/confluent-cl...
👾 Demo code: github.com/confluentinc/demo-...
🤔 Questions? Join the Confluent Community at confluent.io/community/ask-th...
-----
⏱ Time codes
00:00:00 Introduction
00:00:36 Listing topics in Confluent Control Center
00:00:41 Viewing the messages in a topic in Confluent Control Center
00:01:28 Creating a ksqlDB stream on existing topics in Apache Kafka
00:02:05 Querying a stream in ksqlDB from Confluent Control Center
00:02:47 Merging streams of data in ksqlDB
00:03:18 Create the target stream with CREATE STREAM
00:03:41 Adding metadata fields
00:03:49 Creating unique fields by concatenating values
00:04:13 Setting the partitioning key
00:04:33 Add new streams into the target stream with INSERT INTO
00:05:24 Inspecting running ksqlDB queries with Confluent Control Center
00:05:53 Querying the merged stream
00:06:27 Merging streams - recap
00:07:08 Splitting a Kafka topic into separate streams with ksqlDB
00:09:00 Splitting a stream - recap

Наука

Опубликовано:

 

3 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 14   
@brunobule9762
@brunobule9762 3 года назад
KSQL is so incredible. (from Angola)
@rmoff
@rmoff 3 года назад
It certainly is :)
@Evkayne
@Evkayne Год назад
thank you
@foolaris
@foolaris 3 года назад
That is what we need, awesome!
@rmoff
@rmoff 3 года назад
Thanks :)
@user-qd4nw5mi6y
@user-qd4nw5mi6y 4 месяца назад
I'm attempting to create a stream from a multi schema topic, similar to the train example at the end of this video. I would then split into multiple streams/topics for each message type. However, I can't seem to create the stream in a way that it's populated with the messages from the multi schema topic. Is there an actual example you can reference for this scenario?
@mathiasyeremiaaryadi9097
@mathiasyeremiaaryadi9097 Год назад
Can we make the insert query persistent ? So then it will be running automatically, not at that time when we write the query
@ashvanthkumarselvakumaran5874
Can I consume from two topics in one Kafka instance, then combine and push it to another Kafka instance?
@rmoff
@rmoff Год назад
ksqlDB can only connect to one Kafka cluster at a time. Please head over to www.confluent.io/en-gb/community/ask-the-community/ for more help with this requirement.
@aldovc
@aldovc 3 года назад
I noticed that topics and streams are mentioned interchangeably, it it safe to assume the concepts are essentially the same but their usage is where we find the differences? Thank you
@rmoff
@rmoff 3 года назад
Hi Aldo, a stream is a topic but with a schema declared. Both are immutable unbounded streams of events :) Let me know if that answers your question.
@aldovc
@aldovc 3 года назад
@@rmoff Thank you for your reply! It makes a lot of sense now. Great content, keep it up!
@mickeyp1291
@mickeyp1291 2 года назад
is the schema created reused or called ORDERS_COMBINED-value ? or can you use another name ?
@rmoff
@rmoff 2 года назад
The schema is tied to the topic, and inherits (but does not reuse) the parent schema. IIRC it'll take the name of -value by default.
Далее
ksqlDB HOWTO: Reserialising data in Apache Kafka
17:42
Просмотров 1,9 тыс.
ksqlDB HOWTO: Stateful Aggregates
13:56
Просмотров 2,8 тыс.
БАТЯ И СОСЕД😂#shorts
00:59
Просмотров 1,3 млн
кажется, началось
00:45
Просмотров 1,4 млн
ksqlDB HOWTO: Handling Time
9:08
Просмотров 2,4 тыс.
ksqlDB HOWTO: Schema Manipulation
10:56
Просмотров 1,6 тыс.