v.25.11New Feature

Support arrayRemove to remove all elements equal

Support for arrayRemove to remove all elements equal to elem from the array arr. Which is only needed for compatibility with Postgres, as ClickHouse already has a way more powerful, arrayFilter function. Resolves #52099. #89585 (tiwarysaurav).
Added support for the arrayRemove function to remove all elements equal to a specified value from an array.

Why it matters

This feature provides compatibility with Postgres by introducing the arrayRemove function, allowing users to remove all occurrences of a specified element from an array easily. Although ClickHouse already offers the more flexible arrayFilter function, arrayRemove simplifies scenarios where only removal of equal elements is needed.

How to use it

Use the arrayRemove(arr, elem) function where arr is the array and elem is the element to be removed from the array. It returns a new array excluding all elements equal to elem.

Example:
SELECT arrayRemove([1, 2, 3, 2], 2);
-- Result: [1, 3]