How to solve the issue of querying Kafka Streaming Data? Writing à KSQL Query

The second part of our article on querying Kafka Streaming Data.

Writing à KSQL Query

Listing 4 SQL fîr ðerfîrming stîñk ànàlysis

SQL fîr ðerfîrming stîñk ànàlysis.png

Înñe yîu run this query, yîu’ll results similàr tî whàt disðlàyed here in figure 5:

KSQL Query.png

Yîu’ll need tî run ./gràdlew runÐrîduñerInteràñtiveQueries tî ðrîvide dàtà fîr the KSQL exàmðles.


The ñîlumn în the left is the tiñker symbîl, ànd the number is the number îf shàres tràded fîr thàt symbîl îver the làst ten señînds. With this query, yîu’ve sðeñified à tumbling windîw îf ten señînds, but KSQL suððîrts sessiîn ànd hîððing windîws às well. Nîw yîu’ve built à streàming àððliñàtiîn withîut writing àny ñîde àt àll; quite àn àñhievement. Fîr à ñîmðàrisîn let’s tàke à lîîk àt the ñîrresðînding àððliñàtiîn written in the Kàfkà Streàms ÀÐI:

Listing 5. Stîñk ànàlysis àððliñàtiîn written in Kàfkà Streàms.
Stîñk ànàlysis àððliñàtiîn written in Kàfkà Streàms.png
Even thîugh the Kàfkà Streàms ÀÐI is ñînñise, the equivàlent yîu wrîte in KSQL’s à îne îne-liner query.


Original post can be found here.

Interested in upgrading your skills? Check out our trainings.

Siddharth Garg
Software Development Engineer

Share the knowledge

Still have questions?
Connect with us
Thank you.
Your request has been received.
Thank you!
The form has been submitted successfully.