Robin Moffatt has an example where he enriches streaming CSV data with information stored in MySQL:
This is a continuous query that executes in the background until explicitly terminated by the user. In effect, these are stream processing applications, and all we need to create them is SQL! Here all we’ve done is an enrichment (joining two sets of data), but we could easily add predicates to the data (simply include a
WHERE
clause), or even aggregations.
You can see which queries are running with the
SHOW QUERIES;
statement. All queries will pause if the KSQL server stops, and restart automagically when the KSQL server starts again.
The
DESCRIBE EXTENDED
command can be used to see information about the derived stream such as the one created above. As well as simply the columns involved, we can see information about the underlying topic, and run-time stats such as the number of messages processed and the timestamp of the most recent one.
It’s pretty easy to do; click through to see just how easy.
Comments closed