{"id":28389,"date":"2020-12-28T12:16:35","date_gmt":"2020-12-28T12:16:35","guid":{"rendered":"https:\/\/www.testpreptraining.com\/tutorial\/?page_id=28389"},"modified":"2020-12-28T12:16:36","modified_gmt":"2020-12-28T12:16:36","slug":"select-the-appropriate-windowing-functions","status":"publish","type":"page","link":"https:\/\/www.testpreptraining.ai\/tutorial\/select-the-appropriate-windowing-functions\/","title":{"rendered":"Select the appropriate windowing functions"},"content":{"rendered":"\n<p><a href=\"https:\/\/www.testpreptraining.ai\/tutorial\/exam-dp-200-implementing-an-azure-data-solution\/\" target=\"_blank\" rel=\"noreferrer noopener\">Go back to DP-200 Tutorials<\/a><\/p>\n\n\n\n<p>In time-streaming scenarios, performing operations on the data contained in temporal windows is a common pattern. Stream Analytics has native support for windowing functions, enabling developers to author complex stream processing jobs with minimal effort. However, there are five kinds of temporal windows to choose from: Tumbling, Hopping, Sliding, Session, and Snapshot windows. And, you use the window functions in the GROUP BY clause of the query syntax in your Stream Analytics jobs. You can also aggregate events over multiple windows using the Windows() function.<\/p>\n\n\n\n<p>You should know that, all the windowing operations output results at the end of the window. Note that when you start a stream analytics job, you can specify the Job output start time and the system will automatically fetch previous events in the incoming streams to output the first window at the specified time. For example, when you start with the Now option, it will start to emit data immediately. The output of the window will be single event based on the aggregate function used. The output event will have the time stamp of the end of the window and all window functions are defined with a fixed length.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/docs.microsoft.com\/en-us\/azure\/stream-analytics\/media\/stream-analytics-window-functions\/stream-analytics-window-functions-conceptual.png\" alt=\"Stream Analytics window functions concepts\" width=\"804\" height=\"346\"\/><figcaption>Image Source: Microsoft<\/figcaption><\/figure><\/div>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Tumbling window<\/strong><\/h4>\n\n\n\n<p>Tumbling window functions are used to segment a data stream into distinct time segments and perform a function against them, such as the example below. However, the key differentiators of a Tumbling window are that they repeat, do not overlap, and an event cannot belong to more than one tumbling window.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/docs.microsoft.com\/en-us\/azure\/stream-analytics\/media\/stream-analytics-window-functions\/stream-analytics-window-functions-tumbling-intro.png\" alt=\"Stream Analytics tumbling window\" width=\"799\" height=\"493\"\/><figcaption>Image Source: Microsoft<\/figcaption><\/figure><\/div>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Hopping window<\/strong><\/h4>\n\n\n\n<p>Hopping window functions hop forward in time by a fixed period. Moreover, it may be easy to think of them as Tumbling windows that can overlap and be emitted more often than the window size. Events can belong to more than one Hopping window result set. Further, to make a Hopping window the same as a Tumbling window, specify the hop size to be the same as the window size.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img decoding=\"async\" src=\"https:\/\/docs.microsoft.com\/en-us\/azure\/stream-analytics\/media\/stream-analytics-window-functions\/stream-analytics-window-functions-hopping-intro.png\" alt=\"Stream Analytics hopping window\" width=\"-372\" height=\"-157\"\/><figcaption>Image Source: Microsoft<\/figcaption><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.testpreptraining.ai\/implementing-an-azure-data-solution-dp-200-free-practice-test\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" width=\"961\" height=\"150\" src=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/08\/dp-200-pracice-tests-1.png\" alt=\"DP-200 practice tests\" class=\"wp-image-18535\" srcset=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/08\/dp-200-pracice-tests-1.png 961w, https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/08\/dp-200-pracice-tests-1-750x117.png 750w\" sizes=\"auto, (max-width: 961px) 100vw, 961px\" \/><\/a><\/figure><\/div>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Sliding window<\/strong><\/h4>\n\n\n\n<p>Sliding windows, unlike Tumbling or Hopping windows, output events only for points in time when the content of the window actually changes. In other words, when an event enters or exits the window. So, every window has at least one event. Similar to Hopping windows, events can belong to more than one sliding window.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img decoding=\"async\" src=\"https:\/\/docs.microsoft.com\/en-us\/azure\/stream-analytics\/media\/stream-analytics-window-functions\/stream-analytics-window-functions-sliding-intro.png\" alt=\"Stream Analytics sliding window\" width=\"-447\" height=\"-206\"\/><figcaption>Image Source: Microsoft<\/figcaption><\/figure><\/div>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Session window<\/strong><\/h4>\n\n\n\n<p>Session window functions group events that arrive at similar times, filtering out periods of time where there is no data. However, it has three main parameters: timeout, maximum duration, and partitioning key (optional).<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/docs.microsoft.com\/en-us\/azure\/stream-analytics\/media\/stream-analytics-window-functions\/stream-analytics-window-functions-session-intro.png\" alt=\"Stream Analytics session windowing\" width=\"744\" height=\"309\"\/><figcaption>Image Source: Microsoft<\/figcaption><\/figure><\/div>\n\n\n\n<p>Firstly, a session window begins when the first event occurs. And, if another event occurs within the specified timeout from the last ingested event. Then, the window extends to include the new event. Otherwise if no events occur within the timeout, then the window is closed at the timeout.<\/p>\n\n\n\n<p>Further, if events keep occurring within the specified timeout, the session window will keep extending until maximum duration is reached. The maximum duration checking intervals are set to be the same size as the specified max duration. For example, if the max duration is 10, then the checks on if the window exceed maximum duration will happen at t = 0, 10, 20, 30, etc.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Snapshot window<\/strong><\/h4>\n\n\n\n<p>Snapshot windows groups events that have the same timestamp. Unlike other windowing types, which require a specific window function (such as SessionWindow(), you can apply a snapshot window by adding System.Timestamp() to the GROUP BY clause.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/docs.microsoft.com\/en-us\/azure\/stream-analytics\/media\/stream-analytics-window-functions\/snapshot.png\" alt=\"Stream Analytics snapshot windowing\" width=\"867\" height=\"352\"\/><figcaption>Image Source: Microsoft<\/figcaption><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.testpreptraining.ai\/implementing-an-azure-data-solution-dp-200-practice-exam\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" width=\"961\" height=\"150\" src=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/08\/dp-200-online-course-1.png\" alt=\"Select the appropriate windowing functions DP-200 Online course\" class=\"wp-image-18534\" srcset=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/08\/dp-200-online-course-1.png 961w, https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/08\/dp-200-online-course-1-750x117.png 750w\" sizes=\"auto, (max-width: 961px) 100vw, 961px\" \/><\/a><\/figure><\/div>\n\n\n\n<p class=\"has-text-align-right\"><strong>Reference: <\/strong><a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/stream-analytics\/stream-analytics-window-functions\" target=\"_blank\" rel=\"noreferrer noopener\">Microsoft Documentation<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/www.testpreptraining.ai\/tutorial\/exam-dp-200-implementing-an-azure-data-solution\/\" target=\"_blank\" rel=\"noreferrer noopener\">Go back to DP-200 Tutorials<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Go back to DP-200 Tutorials In time-streaming scenarios, performing operations on the data contained in temporal windows is a common pattern. Stream Analytics has native support for windowing functions, enabling developers to author complex stream processing jobs with minimal effort. However, there are five kinds of temporal windows to choose from: Tumbling, Hopping, Sliding, Session,&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-28389","page","type-page","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Select the appropriate windowing functions - Testprep Training Tutorials<\/title>\n<meta name=\"description\" content=\"Enhance your skill and knowledge by learning about windowing functions using Microsoft DP-200 online course and Practice Exam Now!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.testpreptraining.ai\/tutorial\/select-the-appropriate-windowing-functions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Select the appropriate windowing functions - Testprep Training Tutorials\" \/>\n<meta property=\"og:description\" content=\"Enhance your skill and knowledge by learning about windowing functions using Microsoft DP-200 online course and Practice Exam Now!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.testpreptraining.ai\/tutorial\/select-the-appropriate-windowing-functions\/\" \/>\n<meta property=\"og:site_name\" content=\"Testprep Training Tutorials\" \/>\n<meta property=\"article:modified_time\" content=\"2020-12-28T12:16:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/docs.microsoft.com\/en-us\/azure\/stream-analytics\/media\/stream-analytics-window-functions\/stream-analytics-window-functions-conceptual.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/select-the-appropriate-windowing-functions\/\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/select-the-appropriate-windowing-functions\/\",\"name\":\"Select the appropriate windowing functions - Testprep Training Tutorials\",\"isPartOf\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#website\"},\"datePublished\":\"2020-12-28T12:16:35+00:00\",\"dateModified\":\"2020-12-28T12:16:36+00:00\",\"description\":\"Enhance your skill and knowledge by learning about windowing functions using Microsoft DP-200 online course and Practice Exam Now!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/select-the-appropriate-windowing-functions\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.testpreptraining.ai\/tutorial\/select-the-appropriate-windowing-functions\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/select-the-appropriate-windowing-functions\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Select the appropriate windowing functions\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#website\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\",\"name\":\"Testprep Training Tutorials\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.testpreptraining.ai\/tutorial\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#organization\",\"name\":\"Testprep Training\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png\",\"contentUrl\":\"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png\",\"width\":583,\"height\":153,\"caption\":\"Testprep Training\"},\"image\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Select the appropriate windowing functions - Testprep Training Tutorials","description":"Enhance your skill and knowledge by learning about windowing functions using Microsoft DP-200 online course and Practice Exam Now!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.testpreptraining.ai\/tutorial\/select-the-appropriate-windowing-functions\/","og_locale":"en_US","og_type":"article","og_title":"Select the appropriate windowing functions - Testprep Training Tutorials","og_description":"Enhance your skill and knowledge by learning about windowing functions using Microsoft DP-200 online course and Practice Exam Now!","og_url":"https:\/\/www.testpreptraining.ai\/tutorial\/select-the-appropriate-windowing-functions\/","og_site_name":"Testprep Training Tutorials","article_modified_time":"2020-12-28T12:16:36+00:00","og_image":[{"url":"https:\/\/docs.microsoft.com\/en-us\/azure\/stream-analytics\/media\/stream-analytics-window-functions\/stream-analytics-window-functions-conceptual.png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/select-the-appropriate-windowing-functions\/","url":"https:\/\/www.testpreptraining.ai\/tutorial\/select-the-appropriate-windowing-functions\/","name":"Select the appropriate windowing functions - Testprep Training Tutorials","isPartOf":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#website"},"datePublished":"2020-12-28T12:16:35+00:00","dateModified":"2020-12-28T12:16:36+00:00","description":"Enhance your skill and knowledge by learning about windowing functions using Microsoft DP-200 online course and Practice Exam Now!","breadcrumb":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/select-the-appropriate-windowing-functions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.testpreptraining.ai\/tutorial\/select-the-appropriate-windowing-functions\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/select-the-appropriate-windowing-functions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.testpreptraining.ai\/tutorial\/"},{"@type":"ListItem","position":2,"name":"Select the appropriate windowing functions"}]},{"@type":"WebSite","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#website","url":"https:\/\/www.testpreptraining.ai\/tutorial\/","name":"Testprep Training Tutorials","description":"","publisher":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.testpreptraining.ai\/tutorial\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#organization","name":"Testprep Training","url":"https:\/\/www.testpreptraining.ai\/tutorial\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/","url":"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png","contentUrl":"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png","width":583,"height":153,"caption":"Testprep Training"},"image":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/28389","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/comments?post=28389"}],"version-history":[{"count":7,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/28389\/revisions"}],"predecessor-version":[{"id":28589,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/28389\/revisions\/28589"}],"wp:attachment":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/media?parent=28389"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/categories?post=28389"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/tags?post=28389"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}