Blog Post

Azure Data Explorer Blog
1 MIN READ

Breaking change in window functions

gabil's avatar
gabil
Icon for Microsoft rankMicrosoft
Sep 07, 2022

Detailed description 

This is a Breaking change when using window functions inside partition operator sub-query scope.

Window functions require a serialized/ordered input.

There is a bug in Azure Data Explorer logic that allows using window functions inside the partition operator when the ordering is performed outside the partition query scope like this:

 

T

| where Timestamp > ago(1d)

| order by Timestamp asc

| partition by key

(

    extend next_value =  next(value)

    ...

)

 

This kind of query currently works unintentionally and sometimes the output is not correct.

We’re planning to make a change that will fail this kind of queries by throwing a semantic error indicating that the input to the window function is not serialized.

Required change 

Fix all relevant queries by pushing the ordering inside the partition subquery like shown below.

 

T

| where Timestamp > ago(1d)

| partition by key

(

    order by Timestamp asc

    | extend next_value =  next(value)

    ...

)

Schedule & plan  

Support for previous window function pattern will be blocked - ETA: November 30, 2022 

 

Published Sep 07, 2022
Version 1.0
No CommentsBe the first to comment