Тёмный

ksqlDB HOWTO: Stateful Aggregates 

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

Using ksqlDB you can build stateful aggregations of state on events in Apache Kafka topics. These are persisted as Kafka topics and held in a state store within ksqlDB that you can query directly or from an external application using the Java client or REST API.
ksqlDB uses SQL to describe the stream processing that you want to do. For example:
CREATE TABLE ORDERS_BY_MAKE AS
SELECT MAKE,
COUNT(*) AS ORDER_COUNT,
SUM(TOTAL_ORDER_VALUE) AS TOTAL_ORDER_VALUE
FROM ORDERS
GROUP BY MAKE;
-----
💾 Run ksqlDB yourself: ksqldb.io?.devx_ch.rmoff_youtube__-j7aKE0kl0&
☁️ 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...
ksqlDB REST API: docs.ksqldb.io/en/latest/deve...
ksqlDB Java client: docs.ksqldb.io/en/latest/deve...
-----
⏱ Time codes
00:00:00 Introduction
00:00:48 Querying the source stream
00:01:28 COUNT(*)… GROUP BY in ksqlDB
00:02:02 Continuous aggregation
00:02:11 As new data arrives, the aggregate is updated
00:02:36 Persisting an aggregate in ksqlDB as a TABLE
00:03:04 Why are aggregates TABLEs? Because they're a value for a given key (the GROUP BY clause)
00:03:20 CREATE TABLE … AS SELECT
00:03:42 Listing tables in ksqlDB
00:03:48 Examining the schema of a table
00:03:56 Querying a table (push query)
00:04:35 ksqlDB creates internal state store to hold aggregates
00:04:55 Querying the state store directly in ksqlDB (pull query)
00:05:11 Quyerying the materialised cache in ksqlDB
00:05:45 Pull vs Push queries
00:06:34 Windowed aggregations in ksqlDB
00:07:29 Creating a tumbling window in ksqlDB
00:07:39 Keys in windowed aggregations
00:07:49 Windows start from the Unix epoch
00:08:09 Casting DOUBLE to DECIMAL in ksqlDB
00:08:20 Using a pull query to view the state of a tumbling windowed aggregate in ksqlDB
00:08:31 WINDOWSTART and WINDOWEND system columns
00:09:48 Handling late-arriving data in ksqlDB
00:10:10 Querying the ksqlDB materialised state store from an application
00:10:48 Building aggregates to alert on a threshold with the HAVING clause
00:12:03 Writing threshold alerts to a new Kafka topic
00:12:55 Recap

Наука

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

 

3 авг 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 13   
@RamKotamraju
@RamKotamraju 3 года назад
Ksqldb windowing was little bit confusing earlier , but your video made it understand it so clearly Robin. Thanks for your simple and vanilla instructions
@rmoff
@rmoff 3 года назад
Thanks, glad I could help! :)
@toenytv7946
@toenytv7946 3 года назад
Show streams were very helpful. Thank you.
@rmoff
@rmoff 3 года назад
Glad you like them!
@julioribeiro1909
@julioribeiro1909 3 года назад
by the way, your blog and videos are super-useful
@rmoff
@rmoff 3 года назад
Thanks :)
@bjornmartin6480
@bjornmartin6480 3 года назад
i guess I'm kinda off topic but do anybody know a good website to watch new movies online ?
@terryjefferson747
@terryjefferson747 3 года назад
@Bjorn Martin i would suggest FlixZone. Just google for it =)
@georgecason9627
@georgecason9627 3 года назад
@Terry Jefferson Definitely, have been using FlixZone for months myself =)
@bjornmartin6480
@bjornmartin6480 3 года назад
@Terry Jefferson Thanks, I went there and it seems like they got a lot of movies there :D I appreciate it!
@SirKober
@SirKober 3 года назад
10:20 Is there no way to write that to a Kafka topic? Cause when I try to create a stream from my aggregated windowed table to get the aggregated value, and the windowStart/windowEnd ksqldb gives me this error: "KSQL does not support persistent queries on windowed tables"
@rmoff
@rmoff 3 года назад
Yeah I believe this is a limitation currently. Head to the ksqlDB at forum.confluent.io/ to confirm, and/or check the issues at github.com/confluentinc/ksql/issues
Далее
ksqlDB HOWTO: Joins
10:23
Просмотров 2,7 тыс.
ksqlDB HOWTO: Reserialising data in Apache Kafka
17:42
Просмотров 1,9 тыс.
Help Barry And Barry Woman Scan Prisoners
00:23
Просмотров 2,4 млн
кажется, началось
00:45
Просмотров 1,4 млн
ksqlDB HOWTO: Schema Manipulation
10:56
Просмотров 1,6 тыс.
Solving one of PostgreSQL's biggest weaknesses.
17:12
Просмотров 186 тыс.
What is Apache Kafka®?
11:42
Просмотров 346 тыс.
ksqlDB HOWTO: Handling Time
9:08
Просмотров 2,4 тыс.
Why The Windows Phone Failed
24:08
Просмотров 119 тыс.
Wait... PostgreSQL can do WHAT?
20:33
Просмотров 191 тыс.
ksqlDB HOWTO: Split and Merge Kafka Topics
10:18
Просмотров 3,5 тыс.
KSQL Use Cases | Level Up your KSQL by Confluent
11:00
Новые iPhone 16 и 16 Pro Max
0:42
Просмотров 2,3 млн
АЙФОН Г0ВН0
0:54
Просмотров 1,7 млн