Designing and creating windowed aggregates
In this section, let's explore the different windowed aggregates that are available in ASA. ASA supports the following five types of windows:
- Tumbling windows
- Hopping windows
- Sliding windows
- Session windows
- Snapshot windows
Let's look at each of them in detail. We will be using the following sample event schema in our examples.
eventSchema = StructType() .add("tripId", StringType()) .add("createdAt", TimestampType()) .add("startLocation", StringType()) .add("endLocation", StringType()) .add("distance", IntegerType()) .add("fare", IntegerType())
Let us start with Tumbling windows.
Tumbling windows
Tumbling windows are non-overlapping time windows. All the windows are of the same size. Here is a depiction of how they look: