Jump to content

Breaking change in window functions


Recommended Posts

Guest Gabi Lehner
Posted

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

 

Continue reading...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...