Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement array_has function #6977

Closed
izveigor opened this issue Jul 15, 2023 · 2 comments · Fixed by #6990
Closed

Implement array_has function #6977

izveigor opened this issue Jul 15, 2023 · 2 comments · Fixed by #6990
Labels
enhancement New feature or request

Comments

@izveigor
Copy link
Contributor

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

@jayzhan211
Copy link
Contributor

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

@izveigor
Copy link
Contributor Author

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
Labels
enhancement New feature or request
Projects
None yet
2 participants