diff --git a/docs/design/2022-05-12-window-function.md b/docs/design/2022-05-12-window-function.md index d04ab5edba9..400db878ca2 100644 --- a/docs/design/2022-05-12-window-function.md +++ b/docs/design/2022-05-12-window-function.md @@ -94,7 +94,7 @@ Children task's cost *= 0.05 ### The Logic of Window Function in TiFlash #### Major additions - IWindowFunction - Defines execution functions of a window function(row_number, rank, dense_rank). + Defines execution functions of a window function(row_number, rank, dense_rank, lead, lag). - WindowDescription Define a window, including the name, frame, functions of a window. - WindowBlockInputStream @@ -125,7 +125,7 @@ Children task's cost *= 0.05 ##### Flow Chart ![tiflash-window-function-flow-chart](./images/tiflash-window-function-flow-chart.jpg) ### Support and Limit -- Compared with TiDB, currently only row_number, rank, dense_rank functions are supported. +- Compared with TiDB, currently only row_number, rank, dense_rank, lead, lag functions are supported. | Feature | support | | ----- | ----- | @@ -136,7 +136,7 @@ Children task's cost *= 0.05 | INTERVAL syntax for DateTime RANGE OFFSET frame | Not supported | | Calculating aggregate functions over a frame | Not supported | | rank(), dense_rank(), row_number() | Supported | -| lag/lead(value, offset, default) | Not supported | +| lag/lead(value, offset, default) | Supported | - Compared with TiDB or MySQL, the result may have some differences. For example, compare the calculation results of TiFlash and TiDB: