Skip to content

Implement array_intersect function #6978

@izveigor

Description

@izveigor

Is your feature request related to a problem or challenge?

Summary

Characteristic Description
Function name: array_intersect
Aliases: list_intersect, &&
Original function?: No
Function Description: Azure DataBricks: Returns an array of the elements in the intersection of array1 and array2.
Clickhouse: Takes multiple arrays, returns an array with elements that are present in all source arrays.
DuckDB: Returns a list of all the elements that exist in both l1 and l2, without duplicates.
Sources: Concept Azure ClickHouse DuckDB

Examples:

select array_intersect([1, 2, 3, 4], [5, 6, 3, 4]);
----
[3, 4]
select array_intersect([1, 2, 3, 4], [5, 6, 7, 8]);
----
[]

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions