Skip to content

Implement array_has function #6977

Closed

Description

@izveigor

Is your feature request related to a problem or challenge?

Summary

Characteristic Description
Function name: array_has
Aliases: list_has, array_contains, list_contains
Original function?: No
Function Description: Azure DataBricks: Returns true if array contains value.
Clickhouse: Checks whether the ‘arr’ array has the ‘elem’ element. Returns 0 if the element is not in the array, or 1 if it is.
DuckDB: Returns true if the list contains the element.
Sources: Concept Azure ClickHouse DuckDB

Examples:

select array_has([1, 2, 3, 4], 3);
----
true
select array_has([1, 2, 3, 4], 5);
----
false

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

Activity

  1. jayzhan211 commented on Jul 16, 2023

    @jayzhan211
    Contributor

    The original function is No in the description, but I think array_has is the same as the current function array_contains right?

  2. izveigor commented on Jul 16, 2023

    @izveigor
    ContributorAuthor

    The original function is No in the description, but I think array_has is the same as the current function array_contains right?

    Yes, the current implementation array_contains is equal to the future array_has_all (only we should rename it and include support column).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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