Skip to content

Conversation

@kosiew
Copy link
Contributor

@kosiew kosiew commented Oct 29, 2024

Which issue does this PR close?

Completes a task in #463

Rationale for this change

This PR introduces a new function, cardinality, which returns the number of distinct elements in a array

What changes are included in this PR?

Added the cardinality function.
Updated the Python bindings in functions.py and provided unit tests for cardinality in test_functions.py.
Updated the documentation (expressions.rst) to include examples on how to use the new cardinality function.

Are there any user-facing changes?

The cardinality function is now available for users working with arrays. It is exposed both in Rust and Python, allowing users to obtain the number of distinct elements in their DataFusion queries.

There are no breaking changes to public APIs.

Copy link
Member

@timsaucer timsaucer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! Thank you.

@timsaucer timsaucer merged commit e015482 into apache:main Oct 29, 2024
timsaucer pushed a commit to timsaucer/datafusion-python that referenced this pull request Nov 9, 2024
@kosiew kosiew deleted the add-cardinality branch November 25, 2024 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants