Time handling in Cloudera SQL Stream Builder

Time attributes control how Cloudera SQL Stream Builder (SSB) runs time-based operations, such as window aggregations and joins. You define them on the Event Time tab of a Kafka table, or in Flink DDL.

Flink SQL supports two kinds of time attributes:

  • Processing time is the time of the machine that processes a record. Define it with a computed column, for example proctime AS PROCTIME().
  • Event time is a timestamp in the record itself. Define it with a WATERMARK clause on a TIMESTAMP(3) or TIMESTAMP_LTZ(3) column. The watermark tells Flink how long to wait for late records.

For Kafka tables, use the Event Time tab of the table to choose the timestamp. By default, SSB uses the Kafka record timestamp as the eventTimestamp column, with a watermark of 3 seconds. You can also choose a column from the data in the Event Time Column field. For more information, see Defining event time for Kafka tables.

For other tables, define time attributes in the CREATE TABLE statement. You can use a timestamp that the source provides, or compute your own. For more information, see Using source-provided timestamps and Using user-provided timestamps.

For the concepts, see Event time and watermarks and Time attributes in the Apache Flink documentation.