Skip to content

Add Table Functions to FFI Crate #15581

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

Merged
merged 5 commits into from
Apr 12, 2025
Merged

Conversation

timsaucer
Copy link
Contributor

Which issue does this PR close?

This addresses part of #14562

Rationale for this change

We currently have support for user defined scalar functions. Aggregates and Windows are underway. This PR adds user defined table functions.

What changes are included in this PR?

  • Implement the user FFI crate requirements.
  • Adds one round trip unit test.
  • Adds one full integration test where different shared library is used.

Are these changes tested?

Yes, tests added to the PR.

Are there any user-facing changes?

None, but additional APIs are now available.

@github-actions github-actions bot added the ffi Changes to the ffi crate label Apr 4, 2025
@timsaucer timsaucer force-pushed the feat/ffi-table-udf branch from ca6cf45 to 7681029 Compare April 4, 2025 20:26
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Looks good to me -- thank you @timsaucer


/// This test validates nullary input UDFs
#[tokio::test]
async fn test_nullary_scalar_udf() -> Result<()> {
Copy link
Contributor

Choose a reason for hiding this comment

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

A test for nullary udfs seems out of place with tests for user defined table functions -- is this maybe a copy/paste error?

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you want to handle this comment on this PR @timsaucer or shall we merge the PR and handle it later?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, should be good to go now.

@alamb
Copy link
Contributor

alamb commented Apr 9, 2025

Merged up from main to get a clean CI run (hopefully)

@timsaucer
Copy link
Contributor Author

I’ll resolve those clippy warnings next time I’m at my computer

@timsaucer timsaucer merged commit 6f64b0f into apache:main Apr 12, 2025
29 checks passed
@alamb
Copy link
Contributor

alamb commented Apr 12, 2025

Very exciting -- thanks @timsaucer

nirnayroy pushed a commit to nirnayroy/datafusion that referenced this pull request May 2, 2025
* Initial commit adding user defined table functions to FFI crate

* Minor format change

* Remove duplicate test

* Remove unused imports

---------

Co-authored-by: Andrew Lamb <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ffi Changes to the ffi crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants