v.24.2New Feature

Support Negative Positional Arguments

Support negative positional arguments. Closes #57736. #58292 (flynn).
Support for negative positional arguments in ClickHouse functions.

Why it matters

This feature allows users to use negative indices as arguments in functions that accept positional parameters, enabling more flexible and intuitive access to elements relative to the end of a collection. It solves the limitation of only non-negative positional arguments, enhancing usability for array and tuple indexing operations.

How to use it

Users can now pass negative integers as positional arguments in functions that support such parameters. For example, when accessing elements from arrays or tuples, using negative indices will count positions from the end, similar to negative indexing in other programming languages. No special enabling steps are required; the feature is available by default after updating ClickHouse.