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
feat(expr): support array_distinct
#8315
feat(expr): support array_distinct
#8315
Conversation
Thank you for your contribution! |
Yeah sure |
@lmatz To get distinct values, I am using Hashset, as it is unordered, writing the output for e2e tests can be tricky, as output order of elements in the array can change. Do, I sort the input and use dedup instead, it would not be that performant, and I can sort the output after. |
There is a way to get deterministic output with HashSet rather than sorting: scan the array and skip those already in HashSet, add new values to output and HashSet. https://docs.rs/itertools/0.10.5/itertools/trait.Itertools.html#method.unique |
Makes sense will change the logic |
- fixed array_distinct to return inplace ordering of elements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest lgtm. Thank you!
…risingwave into apoorv/array_distinct
Good job! Thanks a lot for your contribution! @snipekill |
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
Feature #7765
Checklist For Contributors
./risedev check
(or alias,./risedev c
)Documentation
Types of user-facing changes
Release note
Support
array_distinct
.