elastic / elasticsearch

Free and Open Source, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
1.32k stars 24.87k forks source link

ESQL: Support Windowing `LAG` & `LEAD` Functions #116213

Open BenB196 opened 2 weeks ago

BenB196 commented 2 weeks ago

Description

Having to the ability compare the results of a row before or after the current row is useful in the data analysis world. SQL generally has the LAG & LEAD functions for this. https://mode.com/sql-tutorial/sql-window-functions#lag-and-lead

Simple example is I'd like to compare bucketed time series data to see if the current result either decreases or increases from the previous result bucket.

elasticsearchmachine commented 2 weeks ago

Pinging @elastic/es-analytical-engine (Team:Analytics)