Tumbling window functions group data streams into time segments (as shown in the following diagram). Tumbling windows means that the window does not repeat or overlap data from one segment waterfall into the next:
Stream Analytics
In Stream Analytics, one way to use a tumbling window to count the events that happen every 10 seconds would be to do the following:
SELECT EventTime, Count(*) AS Count
FROM DeviceStream TIMESTAMP BY CreatedAt
GROUP by EventTime, TumbelingWindow(minuites, 10)
Spark
In Spark, to do the same count of events happening every 10 minutes, you would do the following:
from pyspark.sql.functions import *
windowedDF = eventsDF.groupBy(window("eventTime", "10 minute")).count()