The usage of window functions in TiDB is similar to that in MySQL 8.0. For details, see MySQL Window Functions.
Because window functions reserve additional words in the parser, TiDB provides an option to disable window functions. If you receive errors parsing SQL statements after upgrading, try setting tidb_enable_window_function=0.
The window functions listed here can be pushed down to TiFlash.
Except for GROUP_CONCAT() and APPROX_PERCENTILE(), TiDB supports all GROUP BY aggregate functions. In addition, TiDB supports the following window functions:
Divides a partition into N buckets, assigns the bucket number to each row in the partition, and returns the bucket number of the current row within the partition.