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 unique function #4698

Open
izveigor opened this issue Aug 15, 2023 · 3 comments
Open

Implement unique function #4698

izveigor opened this issue Aug 15, 2023 · 3 comments
Labels
enhancement Any new improvement worthy of a entry in the changelog

Comments

@izveigor
Copy link
Contributor

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
Part of apache/datafusion#7289

Describe the solution you'd like
unique function removes duplicate values (include NULLs) from Array. Does preserve the original order.

Example (PyArrow):

>>> pc.unique(pa.array([1, 2, 1, 4, 5, 2, 4, 1]))
<pyarrow.lib.Int64Array object at 0x7f849d1f2040>
[
  1,
  2,
  4,
  5
]

with nulls:

>>> pc.unique(pa.array([1, 2, 1, 4, None, 5, 2, None, 4, 1]))
<pyarrow.lib.Int64Array object at 0x7f849d1f2040>
[
  1,
  2,
  4,
  null,
  5
]

Describe alternatives you've considered

Additional context
Documentation: https://arrow.apache.org/docs/cpp/compute.html

@izveigor izveigor added the enhancement Any new improvement worthy of a entry in the changelog label Aug 15, 2023
@tustvold
Copy link
Contributor

tustvold commented Aug 15, 2023

I'm not sure we typically provide these sorts of grouping/aggregation functions in arrow-rs? How is it you intend to integrate such a function with the grouping machinery in DataFusion?

@izveigor
Copy link
Contributor Author

Hello, @tustvold!
I created the ticket as I found the similar syntax in other versions of Apache Arrow.
If you consider this function is redundant it is better to implement the functionality in Arrow Datafusion and close the ticket.

@tustvold
Copy link
Contributor

What do you think of implementing this in DataFusion first, and we can then assess whether we upstream a version of it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Any new improvement worthy of a entry in the changelog
Projects
None yet
Development

No branches or pull requests

2 participants