Skip to main content

Posts

Showing posts from December, 2020

Azure Data Explorer - Approaches For Data Aggregation In Kusto

In my previous posts I tried to transcribe the things that were not too obvious for me when I initially started working on Kusto Query Language. Continuing with the same thought, this time I’m going to share a few of the approaches that can be taken to aggregate the data.   Let’s consider the below input data: let demoData = datatable(Environment: string, Version: int , BugCount: int )   [   "dev" ,1, 1,   "test" ,1, 1,   "prod" ,1, 1,   "dev" ,2, 2,   "test" ,2, 0,   "dev" ,3, 2,   "test" ,3, 0,   "prod" ,2,2,   ]; Description Get the average number of bugs falling under each category.   Expected Output   There are several approaches to achieve this.   Approach 1 - Using Partition Operator   Partition operator first partitions the input data with defined criteria and then combines all the results. demoData| partition by Environment (summarize ceiling(avg(BugCount)) by Environment);    Appr