v.25.3New Feature

Add function arraySymmetricDifference

Added function arraySymmetricDifference. It returns all elements from multiple array arguments which do not occur in all arguments. Example: SELECT arraySymmetricDifference([1, 2], [2, 3]) returns [1, 3]. (issue #61673). #76231 (Filipp Abapolov).
Added the arraySymmetricDifference function which returns elements that appear in some but not all of the provided array arguments.

Why it matters

This function allows users to find elements that are unique to one or more arrays, effectively performing a symmetric difference operation across multiple arrays. It simplifies queries that need to identify non-common elements among arrays, enhancing array manipulation capabilities in ClickHouse.

How to use it

Use the arraySymmetricDifference function by passing multiple arrays as arguments. For example:

SELECT arraySymmetricDifference([1, 2], [2, 3])


This returns [1, 3], the elements not common to both arrays.