In this post, we will discuss some important concepts related to handling time in Azure Stream Analytics.
Event time: The instance of time when an event occurs (happens).
Processing Time: The instance of time when the ingested event reaches the processing stage. Typically, the event processing system will take a few moments to process the event data once it has been ingested.
Watermark: An event-time marker which is a measure of the extent to which the events have entered the streaming processor in Azure Stream Analytics. Since the incoming event stream never stops, watermarks provide a progress checkpoint up to a certain point in the stream.
Further, Azure Stream Analytics provides users the option to choose between two Event Times:
1. Arrival Time: Arrival time is the time assigned to the event when it reaches the Stream Analytics input. By default, arrival time is used for processing events. Arrival time can be used through the following properties depending on the type of input used:
- EventEnqueuedUtcTime property for Event Hubs input
- IoTHub.EnqueuedTime property for IoT Hub input
- BlobProperties.LastModified property for blob input
2. Application Time: Application time is included in the event payload; it is the time assigned to the event when it is generated. Application time can be used during event processing by using Timestamp By clause in the SELECT query.