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

Add array_has_duplicates Presto function #3397

Conversation

darrenfu
Copy link
Contributor

@darrenfu darrenfu commented Dec 1, 2022

Summary

  • Adding the array_has_duplicates Presto function to Velox

array_has_duplicates(array(T))

Returns a boolean: whether array has any elements that occur more than once.
T must be coercible to bigint or varchar.

For example:

select array_has_duplicates(ARRAY [1, 2, 2])); -- true
select array_has_duplicates(ARRAY [1, 2, 2, NULL])); -- true
select array_has_duplicates(ARRAY [1, NULL, NULL])); -- true
select array_has_duplicates(ARRAY [1, 2, 3])); -- false
select array_has_duplicates(ARRAY [1, 2, NULL])); -- false
select array_has_duplicates(ARRAY [true, true])); -- input type error
select array_has_duplicates(ARRAY [NULL, NULL])); -- input type error
select array_has_duplicates(NULL); -- null

@netlify
Copy link

netlify bot commented Dec 1, 2022

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit d683a7a
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/63893e78c7226e000865bc04

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 1, 2022
@darrenfu darrenfu mentioned this pull request Dec 1, 2022
@darrenfu darrenfu force-pushed the array_has_duplicates_simpleudf branch from 2f3fa61 to d683a7a Compare December 1, 2022 23:53
@darrenfu
Copy link
Contributor Author

darrenfu commented Dec 2, 2022

Looks like there is a duplicate PR: #3320

@Yuhta
Copy link
Contributor

Yuhta commented Dec 2, 2022

@darrenfu Is it ok we take #3320?

@darrenfu
Copy link
Contributor Author

darrenfu commented Dec 2, 2022

@darrenfu Is it ok we take #3320?

Sg to me. To avoid future duplicate work like this, I'd suggest to log the WIP udf PRs in a consolidated place, e.g. #2262

Thoughts? @mbasmanova

@darrenfu darrenfu closed this Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants