December 2017
Beginner to intermediate
322 pages
6h 43m
English
In this sample, we have a three automated tollbooth and cars pass through every few minutes. The goal is to calculate how many cars have passed through in a given duration.
SELECT COUNT(*) AS Count, TollBoothIdFROM Input1 GROUP BY TumblingWindow(minute, 3), TollBoothId, PartitionId
SELECT COUNT(*) AS Count, TollBoothIdFROM Input1 Partition By PartitionIdGROUP BY TumblingWindow(minute, 3), TollBoothId, PartitionId
WITH Step1 AS ( SELECT COUNT(*) AS Count, TollBoothId, PartitionId FROM Input1 Partition By PartitionId GROUP BY TumblingWindow(minute, 3), TollBoothId, PartitionId ) SELECT SUM(Count) AS Count, TollBoothId FROM Step1 GROUP BY TumblingWindow(minute, ...
Read now
Unlock full access