ClickHouse neighbor function deprecation

ClickHouse 24.6 deprecates the neighbor function.

You can use one of the following workarounds:

  • any(value) over (.... rows between <offset> preceding and <offset> preceding), or following for lead.
  • lagInFrame/leadInFrame, which are analogous, but respect the window frame. To get behavior identical to lag/lead, use rows between unbounded preceding and unbounded following.

Read the ClickHouse documentation to learn how to use window functions to replace the neighbor function or contact us at support@tinybird.co if you need help.