v.24.2New Feature

New Aggregate Function: groupArrayIntersect

A new aggregate function groupArrayIntersect. Follows up: #49862. #59598 (Yarik Briukhovetskyi).
Introduces a new aggregate function groupArrayIntersect that computes the intersection of arrays grouped by a key in an aggregation.

Why it matters

This feature solves the problem of efficiently finding common elements across arrays within grouped data, enabling users to perform intersections during aggregation operations. It simplifies queries where users need to identify shared elements across grouped arrays without manual processing.

How to use it

Use the groupArrayIntersect aggregate function in your queries by applying it to an array column within a GROUP BY context. For example:

SELECT key, groupArrayIntersect(array_column) FROM table GROUP BY key