You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Spico Florin <sp...@gmail.com> on 2018/03/14 13:05:34 UTC
KSQL tumbling window on a custom timestamp message field
Hello!
I've read about the KSQL streaming SQL for Kafka. In my opinion, this is a
big step for performing complex event processing on streams.
In the provides examples there is a TUMBLING window function.
By default, I assume that the windowing is performed on the timestamp
generated by the system.
I would like to know, if there is any support in KSQL to perform window
function a custom field from the message ( for example timestamp or any
field that contains time format).
I look forward for your answers.
Best regards,
Florin
Re: KSQL tumbling window on a custom timestamp message field
Posted by "Matthias J. Sax" <ma...@confluent.io>.
Hi Florin,
just want to point out that KSQL is not part of Apache Kafka and you
might ask your questions on Confluent Google Group instead:
https://groups.google.com/forum/#!forum/confluent-platform
To answer your question: by default KSQL uses the record embedded
metadata timestamp for tumbling windows. However, KSQL can use any
attribute at timestamp field, too.
You would use a 'WITH (TIMESTAMP = columname)' clause. Cf.
https://github.com/confluentinc/ksql/blob/v0.5/docs/syntax-reference.md#create-stream
-Matthias
On 3/14/18 6:05 AM, Spico Florin wrote:
> Hello!
>
> I've read about the KSQL streaming SQL for Kafka. In my opinion, this is a
> big step for performing complex event processing on streams.
>
> In the provides examples there is a TUMBLING window function.
> By default, I assume that the windowing is performed on the timestamp
> generated by the system.
>
> I would like to know, if there is any support in KSQL to perform window
> function a custom field from the message ( for example timestamp or any
> field that contains time format).
>
> I look forward for your answers.
>
> Best regards,
> Florin
>